仅数字验证. [英] Validation For Digits only.

查看:43
本文介绍了仅数字验证.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用asp.net中的验证控件在文本框中仅输入这种格式为"1234.56"的数字.

How to get enter only digits like in This Format "1234.56" in Textbox using validation control in asp.net.

推荐答案

您需要使用正则表达式验证器并推入模式以验证数字,仅此而已.在验证表达式中,使用"^ \ d +
You need to use Regular expression validator and push in a pattern to verify numbers, thats it. In the validation expression use "^\d+


"

希望对您有所帮助.
"

Hope that helps.


您可以轻松地使用正则表达式验证器:
在验证表达式属性中,保留 ^ \ d +
you can easily use Regular expression validator for this:
In the validation expression property keep ^\d+


这篇关于仅数字验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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