C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Calender


Posted Date: 09 Oct 2008      Posted By: Ramya      Member Level: Silver     Points: 1   Responses: 3



hi friends,

i have a calender to get the date of birth.
after selecting the date, if i press tab the present age should be displayed on the next textbox. how can i do this..

please give me the coding...
Am using ASP.NET + C#

thanks





Responses

Author: Mathew Philip    09 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 3

Hello
Try to use Javascript, you can use OnBlur() method to calculate the age and show the result. It will work when the calendar losts its focus

reagrds
Mathew



Author: Gaurav Agrawal    09 Oct 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 3

try this

DateTime dt1 = new DateTime();
DateTime dt2 = new DateTime();
TimeSpan ts = dt2.Subtract(dt1);
Textbox1.Text = Convert.ToString(ts.Days / 365);

GA

Thanks & Regards,

Gaurav Agrawal
Sr.Software Engineer
gaur1982@yahoo.com
09829373514



Author: Paulraj    09 Oct 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

hi!

on the calender selectionchanged or leave focus event
txt = Calender1.value

please try with above code

Good Luck

Paulraj



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : how SMTP port is set ?
Previous : ajax ....plz help
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use