I cant seem to get my custom validation to work. can anyone spot where i
have gone wrong
control
<asp:CustomVali dator ID="checkHandic ap" runat="server"
ControlToValida te="startHandic ap" ErrorMessage="H andicap out of range"
OnServerValidat e="checkHandica p_ServerValidat e" ></asp:CustomValid ator>
code behind
Protected Sub checkHandicap_S erverValidate(B yVal source As Object, ByVal
args As System.Web.UI.W ebControls.Serv erValidateEvent Args) Handles
checkHandicap.S erverValidate
Dim ans As Integer = Integer.Parse(a rgs.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:CustomVali dator ID="checkHandic ap" runat="server"
ControlToValida te="startHandic ap" ErrorMessage="H andicap out of range"
OnServerValidat e="checkHandica p_ServerValidat e" ></asp:CustomValid ator>
code behind
Protected Sub checkHandicap_S erverValidate(B yVal source As Object, ByVal
args As System.Web.UI.W ebControls.Serv erValidateEvent Args) Handles
checkHandicap.S erverValidate
Dim ans As Integer = Integer.Parse(a rgs.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
Comment