costum validator problem

RTT

Newcomer
Joined
Mar 18, 2005
Messages
19
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?
 
thxs... that solved the problem indeed... didn't know u had to use that to trigger validation..

thxs
 
Back
Top