Click here to Skip to main content
15,885,097 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

Im working on project where i need to enter "Date of Birth" and "Date of Joining"(should be more than 21 years) from current date but Date of Birth and Date of Joining should not be same.

Ideally Date of Birth and Date of Joining should have at least 5 years.

this i need to do as 1st option:

Javascript on Date of Birth filling and Date of Joining filling(on focus off)
C# asp.net on click event.

Project is about Registration form for lectures

Thanks
Posted
Comments
Afzaal Ahmad Zeeshan 28-Jun-15 10:16am    
So, what is so hard in that? Did you try anything?
OriginalGriff 28-Jun-15 10:22am    
It's not as simple as you might think: Timespan doesn't support months or years (for obvious reasons) and Days just doesn't cover it properly.
Afzaal Ahmad Zeeshan 28-Jun-15 10:29am    
That is for a valid reason. If .NET had to have extensions for all of this (such as calculating the age) then what the heck would be the job of a developer?

Apart from this, calculating the age of a user is as simple as a few lines of code. This article of mine shares the code for that. Now if someone is as much stupid as to not know how to know whether two values are equal or not, then I am not sure he can get a good (or valid) answer from here.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900