
October 23rd, 2003, 10:08 AM
|
|
Contributing User
|
|
Join Date: Oct 2002
Posts: 91
Time spent in forums: 30 m 52 sec
Reputation Power: 11
|
|
ASP.NET: Problems with CustomValidator...
Hi!
I have a litte problem with my CustomValidator.
What my CustomValidator should do:
The CustomValidator should check if 2 textboxes are empty..
if yes he should diplay a message.
This is my code:
Code:
<asp:customvalidator id="CustomValidator1" runat="server" ErrorMessage="Sie müssen min. 1 Telefonnummer angeben"
Display="Static" OnServerValidate="ValidateExistanceOfPhones"></asp:customvalidator></P>
Code:
<script runat="server">
void ValidateExistanceOfPhones(object source, ServerValidateEventArgs args)
{
args.IsValid = !((m_txtTelephoneNumber.Text.Length == 0) && (m_txtMobileNumber.Text.Length == 0));
}
</script>
the calidator check ValidateExistanceOfPhones. but when args.IsValid = false the message isn't
shown. What is the problem??!
Make I something wrong?
2. quastion: is it possible to check the state of the 2 textboxes on the client side?
when YES how?
best regards,
gicio
|