从日历中读取年龄 [英] Reading age from calender

查看:80
本文介绍了从日历中读取年龄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我给了Calender出生日期。但是我怎么能给出这样的验证(那个年龄应该> 20)?有什么办法吗?当我打电话给datetime时,它会像这样显示(18-12-2013 05:59:42 PM)。但我只需要Date.Can任何人都可以帮助我吗?

I gave Calender for Date of Birth Field. But how can i Give a validation like this(that age should be >20)?.Is there any way. and when i call the datetime itdisplays like this(18-12-2013 05:59:42 PM).But i need only the Date.Can any one help me?

推荐答案

您可以使用ajax calanderextender的控件。它具有属性Format.You可以将属性设置为Format =dd / MM / yyyy。在OnBlur事件中,您可以将该日期转换为年龄,然后进行进一步操作。
You can use control of ajax calanderextender. And it has property Format.You can set the property to Format="dd/MM/yyyy". and on OnBlur event you can convert that date to age, and then make further operations.


这篇关于从日历中读取年龄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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