使用C Sharp在asp.net中的文本框中仅接受字母 [英] acceptin only letters in text box in asp.net using c sharp
本文介绍了使用C Sharp在asp.net中的文本框中仅接受字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不使用javascript的情况下使用c Sharp在asp.net的文本框中仅给出字母
how to give only letters in textbox in asp.net with c sharp without using javascript
推荐答案
此代码项目教程将帮助您解决您的问题
30分钟正则表达式教程 [
This Tutorial From Code Project Will Help U Solve ur problem
The 30 Minute Regex Tutorial[^]
您好,
试试这个-
我们可以为此使用正则表达式验证器:
在验证表达式属性中,保留-"^ \ d +
Hi,
Try this-
We can use Regular expression validator for this:
In the validation expression property keep- "^\d+
."
<asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100; left: 259px; position: absolute;
top: 283px" ValidationGroup="check"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Please Enter Only Numbers" Style="z-index: 101; left: 424px; position: absolute;
top: 285px" ValidationExpression="^\d+
这篇关于使用C Sharp在asp.net中的文本框中仅接受字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文