Date validation in asp.net form

  • Thread starter Thread starter Phil396
  • Start date Start date
P

Phil396

I need to compare two dates given in an asp.net
form and not allow the form to submit information
if the loan date is less than the date the loan was
issued. I tried the comparevalidation control but that
did not work so well any ideas ?
 
Phil396,

Since you are going to post back the dates, I would recommend using the
static Parse or ParseExact method on the DateTime structure. You can pass
in the user input and get dates. If the dates are not valid, you can
indicate that to the user when the page is sent back. If the dates are
valid, comparing them is a simple operation.

Hope this helps.
 
Back
Top