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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pradeep ShetRank #595 · 4K reputationPosted Mar 22, 2015, 12:49 PM EDT
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
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 22, 2015, 7:57 PM EDT
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