如何使用maskedit扩展器屏蔽日期格式为MM / yyyy的文本框?

How to mask textbox with date format MM/yyyy using maskedit extender?
2020-11-25
  •  译文(汉语)
  •  原文(英语)

我有一个TextBox要在我的asp.net应用程序中输入信用卡日期(仅月份和年份).我添加了'TextBoxwith遮罩的编辑扩展器withMask ="99/9999" andMask Type ="Date" . But its not working , it works only when I give the format'99 / 99/ for9999'Mask`.谁能知道解决方案?

解决过程1

使用正则表达式更好,正则表达式使您可以更好地控制验证.

您可以在正则表达式中创建自己的验证规则,然后可以验证文本框.

您可以在Give链接上了解有关正则表达式的更多信息.

http://www.codeproject.com/Articles/206330/Learning-REGEX-regular-expression-in-the-most-ea

I have one TextBox to enter Credit card date (only month & year ) in my asp.net application. I added the 'TextBoxwithmasked edit extenderwithMask="99/9999"andMask Type="Date". But its not working , it works only when I give the format'99/99/9999'forMask` . Can any one know the solution for that?

Solutions1

Its better to use Regular Expression, regular Expression give you more control over validation.

You can create you own validation rule in Regular Expression and then can validate text box.

You can learn more about regular expression on give link.

http://www.codeproject.com/Articles/206330/Learning-REGEX-regular-expression-in-the-most-ea

转载于:https://stackoverflow.com/questions/28061259/how-to-mask-textbox-with-date-format-mm-yyyy-using-maskedit-extender

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入