date validation

fordferret

New Member
What are the methods available for date in ASP.NET<BR>I want to check the date entered by the user is a valid date. (i.e user should not enter 30th feb or user should not enter 31st april)<BR>how can i do this in asp.net?<BR>I found out myself, here it goes<BR><BR>Dim dtDate as DateTime<BR><BR>Try<BR>&nbsp;&nbsp;&nbsp;dtDate = DateTime.Parse(txtDate.Text)<BR>Catch eExcep as Exception<BR>&nbsp;&nbsp;&nbsp;Response.Write("Invalid Date")<BR>End Try<BR><BR>The above is the easy method, but one question is this a better method?
 
Back
Top