在ASP.NET中验证日期时间格式 [英] Validatting datetime format in asp.net
本文介绍了在ASP.NET中验证日期时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文本框,并在该设置格式上将ajax日历控件应用为
dd/MMM/yyyy表示日期应类似于2010年12月1日.
并要验证它.我应该怎么做验证?
我的代码如下:
Hi,
I have a textbox and applied ajax calender control on that set format as
dd/MMM/yyyy means date should be like 01/Dec/2010 .
and want to validate it .What should I do to validate?
My code is below:
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="TextBox2_CalendarExtender" runat="server"
Enabled="True" Format="dd/MMM/yyyy" TargetControlID="TextBox2">
</cc1:CalendarExtender>
提前非常感谢.
Thanks a lot in advance.
推荐答案
使用正则表达式验证器
在此处检查 dd/MMM/yyyy [
Use regular expression validator
check here for dd/MMM/yyyy[^]
这篇关于在ASP.NET中验证日期时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文