ASP.NET编号验证 [英] ASP.NET number validation

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

问题描述

哪种验证控制更好:范围验证器或RegEx验证器?



我问这是因为我们使用的是文本框,用户需要插入数字在0-99之间,包含4位小数(例如:1.4567,0,2345,...)。这个数字需要验证。

What validation control is better: Range Validator, or RegEx Validator?

I am asking this because we are using textbox, where a user needs to insert the number between 0-99, containing 4 decimals (e.g.: 1.4567, 0,2345,…). This number needs to be validated.

推荐答案

如果你想要它完全是四位小数,那么我建议使用正则表达式验证器。



不确定Range Validator是否可以验证确切的小数位数。
If you want it to be four decimals exactly, then I suggest using regex validator.

Not sure if Range Validator can validate for the exact number of decimal places.


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

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