
February 4th, 2001, 08:20 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
customValidator Not Working
<i><b>Originally posted by : Rob (rob@tconsult.com)</b></i><br /><br />Has anyone else been having trouble getting this to work? <br />This should be so easy. I have a user control(pagelet) where I have this code with the date forms and other date functions. But I can not for the life of me get this to call the LeapYearOK function. <br /><br />This is the server control with binded data from a FOR loop <br /><asp  ropDownList id="yr" RUNAT="server" /> <br /><br />This is the Custom Validator <br /><asp:CustomValidator id="CheckLeapYear" runat="server" <br />controlToValidate = "yr" <br />onServerValidate = "LeapYearOK" <br />display="static"> <br />***** <br /></asp:CustomValidator> <br /><br /><br />This is the function <br /><SCRIPT LANGUAGE="vb" RUNAT="server"> <br />Function LeapYearOK(Sender AS Object, value AS String) AS Boolean <br />Dim markYear As Int32 = Int32.FromString(value) <br />If markYear = 2000 then <br />LeapYearOK = True <br />Else <br />LeapYearOK = False <br />End If <br />End Function <br /></SCRIPT> <br /><br />Please note I have required validators in here that <br />work fine. It is only the custom validation. <br />Thanks, <br /><br />Rob <br />
|