S
Slim
I cant seem to get my custom validation to work. can anyone spot where i
have gone wrong
control
<asp:CustomValidator ID="checkHandicap" runat="server"
ControlToValidate="startHandicap" ErrorMessage="Handicap out of range"
OnServerValidate="checkHandicap_ServerValidate" ></asp:CustomValidator>
code behind
Protected Sub checkHandicap_ServerValidate(ByVal source As Object, ByVal
args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
checkHandicap.ServerValidate
Dim ans As Integer = Integer.Parse(args.Value)
Try
If ans > -27 And ans <= 27 Then
args.IsValid = True
Exit Sub
End If
Catch exc As Exception
End Try
args.IsValid = False
End Sub
have gone wrong
control
<asp:CustomValidator ID="checkHandicap" runat="server"
ControlToValidate="startHandicap" ErrorMessage="Handicap out of range"
OnServerValidate="checkHandicap_ServerValidate" ></asp:CustomValidator>
code behind
Protected Sub checkHandicap_ServerValidate(ByVal source As Object, ByVal
args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
checkHandicap.ServerValidate
Dim ans As Integer = Integer.Parse(args.Value)
Try
If ans > -27 And ans <= 27 Then
args.IsValid = True
Exit Sub
End If
Catch exc As Exception
End Try
args.IsValid = False
End Sub