Link to home
Start Free TrialLog in
Avatar of Pemberley1
Pemberley1

asked on

Date validation C# asp.net.

I need to be able to validate that a year put in to a text box is greater than the year 1900.  I have no idea of how to accomplish this.  Please help.
ASKER CERTIFIED SOLUTION
Avatar of jj819430
jj819430

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jj819430
jj819430

<= instead of < if it cannot be 1900

you can also do it as
System.DateTime Acceptable = Convert.ToDateTime("1/1/1900");
if(Convert.ToDateTime(T.Text) > Acceptable)
{
ok
}
else
{
uh oh
}
Avatar of Pemberley1

ASKER

Thanks!!!