在ASP.NET中用于验证有效日期时间的正则表达式 [英] Regular Expression for validating valid date time or not in asp.net

查看:426
本文介绍了在ASP.NET中用于验证有效日期时间的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的

请帮助我验证
文本框中的日期时间

我不知道正则表达式

谢谢您

Dear

Please help me for validation of
Datetime in a textbox

i dont know the regular expressions

thanks you

推荐答案

你好朋友,
使用比较字段验证器
hello friend,
use compare field validator
<asp:CompareValidator ID="cmp3" runat="server" ControlToValidate="txtDate" Display="Dynamic"

 ErrorMessage="Enter valid date"  Type="Date" ValidationGroup="A"></asp:CompareValidator>



"txtDate"是您要在其上应用文本框的ID.
希望对您有帮助.
如果有帮助,请不要忘记将其标记为答案. :)



"txtDate" is Id of your textbox, on which you want to apply.
Hope this will help you.
Don''t forget to mark as answer if it helps. :)


这篇关于在ASP.NET中用于验证有效日期时间的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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