文本框允许数字和(_)和字母 [英] Text box allow numbers and (_) and letters

查看:88
本文介绍了文本框允许数字和(_)和字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在asp.net中编写代码



这里我的文本框只允许数字和字母以及一个下划线特殊人物



请给我任何解决方案EX:名称是:dd_12333



谢谢



我尝试了什么:



< asp:RegularExpressionValidator ID =RegularExpressionValidator1runat =serverControlToValidate =txtApplicationNumberErrorMessage =请仅输入应用程序编号ForeColor =RedValidationExpression =^ [a-zA-Z''_'\ ss] {1,40} $>

解决方案

>


尝试:

。 .. ValidationExpression =^ [0-9a-zA-Z''_'\ ss] {1,40} 


...


Hi,
I am writing code in asp.net

Here my text box allow only numbers and letters and one underscore special character

Please give me any solution EX: Name is: dd_12333

Thanks

What I have tried:

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtApplicationNumber" ErrorMessage="Please Enter Appication Number Only" ForeColor="Red" ValidationExpression="^[a-zA-Z''_'\s]{1,40}$">

解决方案

">


Try:

... ValidationExpression="^[0-9a-zA-Z''_'\s]{1,40}


" ...


这篇关于文本框允许数字和(_)和字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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