Hi,

 CustomValidator is very useful control for validating your form's controls.For example if you want to check if user entered at least 5 character in  password field you can use CustomValidator1_ServerValidate event :

Protected Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

If txtPassword.Text.Length >= 5 Then

args.IsValid = True

Else

args.IsValid = False

End If

End Sub

Good luck!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5