hii..i想在asp.net中使用一个文本框,验证只接受字母,在字母之前或之后不应接受任何数字 [英] hii..i want a textbox in asp.net with validation of accepting only letters no numbers should be accepted before or after the letters

查看:61
本文介绍了hii..i想在asp.net中使用一个文本框,验证只接受字母,在字母之前或之后不应接受任何数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么做..?Plzz帮我做下面的问题。

What Should I do..?Plzz help me to do the following question.

推荐答案

Hi, try to use this regex in your code,

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
    ValidationExpression="[a-zA-Z ]*


ErrorMessage = *有效字符:字母和空格。 />


你可以使用regularexpressionvalidator ....



试试这些

http://forums.asp.net/t/1802963.aspx?allow+only+characters+in+TextBox [ ^ ]



http://www.c-sharpcorner.com/Blogs/10663/enter-only-characters-in-textbox-in-Asp-Net.aspx [ ^ ]



只允许文本框中的字符,而不是数字 [ ^ ]
you can use regularexpressionvalidator....

Try these
http://forums.asp.net/t/1802963.aspx?allow+only+characters+in+TextBox[^]

http://www.c-sharpcorner.com/Blogs/10663/enter-only-characters-in-textbox-in-Asp-Net.aspx[^]

Allow only character in text box, not number[^]


这篇关于hii..i想在asp.net中使用一个文本框,验证只接受字母,在字母之前或之后不应接受任何数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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