Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

It's my first time i want to write a cotum validator but it doesn't seem to

work. In de page i've put this validator:

<asp:CustomValidator id="CVFBeginDate"

OnServerValidate="CVFBeginDate_ServerValidate" runat="server"

ErrorMessage="Please fill in a valid date as startdate"

ControlToValidate="TxtBeginDate">*</asp:CustomValidator>

 

in de codebehindpage i have created this sub:

Protected Sub CVFBeginDate_ServerValidate(ByVal source As System.Object,

ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles

CVFBeginDate.ServerValidate

Try

tmp = args.Value.Split("/")

testDate = New Date(tmp(2).ToString(), tmp(1).ToString(),

tmp(0).ToString())

args.IsValid = True

Catch

args.IsValid = False

End Try

End Sub

 

 

it doesn't seem to work. do you have to put something special to the custom

validator?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...