Click to See Complete Forum and Search --> : Problems with CustomValidator...


gicio
October 23rd, 2003, 11:02 AM
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:


<asp:customvalidator id="CustomValidator1" runat="server" ErrorMessage="Sie müssen min. 1 Telefonnummer angeben"
Display="Static" OnServerValidate="ValidateExistanceOfPhones"></asp:customvalidator></P>




<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