使用c#在asp.net中选择日历中的日期自动计算年龄 [英] auto calculate age on select a date in calendar in asp.net using c#

查看:482
本文介绍了使用c#在asp.net中选择日历中的日期自动计算年龄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在日历控件中选择年龄时计算用户的年龄。我希望在点击按钮时完成此操作。我使用了一个txtbox,在它下面是一个日历控件。我怎么能不使用ajax.Suppose当用户选择2/12/1987然后在数据库中自动age = 26岁应该是submiteed.Thnks。

how can i calculate the age of user when he selects a age in calendar control. i want this to done when button is clicked.I used a txtbox and below it a calendar control. how can i do this without using ajax.Suppose when user selects 2/12/1987 then in database automatically age=26 yr should be submiteed.Thnks.

推荐答案

年龄比你想象的要复杂一点!请参阅此处:与Age合作:它不是与TimeSpan相同! [ ^ ]
Age is a little more complex than you might think! See here: Working with Age: it's not the same as a TimeSpan![^]


这篇关于使用c#在asp.net中选择日历中的日期自动计算年龄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆