文本框控件中的约会值 [英] Dating value in textbox control

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

问题描述



如何设置文本框控件只输入日期值;

Hi,
How I can set textbox control to enter date value only;

推荐答案

你可以使用常规相同的表达式验证器



将controltovalidate属性设置为您正在使用的文本框的名称。



这里是mm / dd / yy的例子

You can use a regular expression validator for the same

Set the controltovalidate property to the name of textbox you are using.

here's an example for mm/dd/yy
<asp:regularexpressionvalidator id="RegularExpressionValidator5" runat="server" xmlns:asp="#unknown">
        ControlToValidate="TextBox8" ErrorMessage="RegularExpressionValidator" 
        ToolTip="Enter in format mm/dd/yyyy" 
        ValidationExpression="^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d


> ****< / asp:regularexpressionvalidator>
">****</asp:regularexpressionvalidator>





这里有各种日期格式的链接你可以使用..

日期表达 br />


将这些代码写在验证器的表达式属性中!!!



:)



And here the link for various date formats you can use..
Date Expressions

Write those code in the expression property of the validator!!!

:)


您可以使用具有正则表达式的maskekctextbox控件将您带到目标。
You can use maskekctextbox control that had regular expressions take you to your goal.


这篇关于文本框控件中的约会值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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