Using multiple controls for validation

  • Thread starter Thread starter chrisoftoday
  • Start date Start date
C

chrisoftoday

I have a form that allows the user to specify a date using three
separate dropdownlists (one for the day, one for month and one for
year). I want to validate this date to check that it is greater than or
equal to the current date.

Is it possible to use a customvalidator and somehow access the values
of the 3 different controls within the OnServerValidate function, or is
there another/better way to do this?
 
Hi
Instead of taking 3 different controls, better take one control i.e
Text box, Give its datatype in DB as datetime. Use calendar control.
After choosing a date from calendar, it will be displayed in That Text
box. It is easy to validate from single control.
DateTime.Today.Year-----This piece of code will give u current date
always. Here u can use if else statement also and u can generate alert
when required using javascript. Try to do in this way, I think this
will help u.

Good Wishes
Raghav Mahajan
 
Back
Top