bsaucer
May 19th, 2004, 03:16 PM
I have a form with two text boxes and a button. For each text box I have a RequiredFieldValidator, and a ValidExpressionValidator (must be 1 to 3 digit integer). These are working as expected.
In addition to those, I have a single CustomValidator. The server-side script for this control checks to see if the lengths of the two integers add up to four.
The ControlToValidate property is blank since it is validating two text boxes at once. When I click the button, I expect the following code to execute:
Private Sub CustomValidator1_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
If Len(TextBox1.Text) + Len(TextBox2.Text) = 4 Then
args.IsValid = True
Else
args.IsValid = False
End If
End Sub
In addition to those, I have a single CustomValidator. The server-side script for this control checks to see if the lengths of the two integers add up to four.
The ControlToValidate property is blank since it is validating two text boxes at once. When I click the button, I expect the following code to execute:
Private Sub CustomValidator1_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
If Len(TextBox1.Text) + Len(TextBox2.Text) = 4 Then
args.IsValid = True
Else
args.IsValid = False
End If
End Sub