Author: LostArrow | Posted on: 2/13/2009 9:39:50 AM | Views : 370

 I have web forms where users enter a date that cannot be in the future. To validate the the data entry I use a compare validator and this line of code in my page load event handler.
compareValidator1.ValueToCompare = DateTime.Today.Date
This has worked well for years, However I now I need to enter several records in a row.  Record 1 validates just fine but after the postback I try to enter the date for record 2 and my compare validator fails to work properly.
I tried this
If not page.ispostback then
   compareValidator1.ValueToCompare = DateTime.Today.ToShortDateString
End if
 
Still no-worky
How can I get my validator to work after postback??
Many thanks ahead of time

 
...

Go to the complete details ...