date textbox field checking if its not in the future asp.net?

XMEGA

New member
Hi,
I have a detail view which has a textbox for date
its datePlanted as a label followed by a textbox field

However I need to check so that the user doesn't enter a date in the future, hard part is the date from the database is set up like so
"20/05/2009 12:00:00 AM"

I am going to assume the user enters all the dates like that when given a blank textbox
I just need to make sure they don't enter a date in the future???

I've been trying something like this...
If e.NewValues("dateplanted") > DateTime.Now Then
lblErrorMessage.Text += "date planted cannot be in the future<br />"
End If
 
Back
Top