i want to validate date of birth or years if user select month,year of birth and date from the dopdownlist
user select month, year,and date and then a validation control tells the age of a person.how to do that
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Khargesh RajputPosted Mar 22, 2015, 11:57 PM
and use javascript on dropdown selected index or using code behind
get age
http://www.c-sharpcorner.com/UploadFile/cd7c2e/apply-client-side-validation-on-dob-selected-by-user/
http://www.aspsnippets.com/Articles/Select-Day-Month-and-Year-Date-from-DropDownList-in-ASPNet.aspx
Pradeep ShetPosted Mar 22, 2015, 4:49 PM
ONce you get all day, month, year just form the DateTime object.
DateTime dtDOB = new Date(yr,month,day);
Now subtract the dtDOB from Current Date;
DateTime.Today - dtDOB