Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to validate a textbox using RegularExpressionValidtor .The textbox shouldn't allow *,% and ' symbols .
Posted

1 solution

Hi,

Please check out below code:

XML
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:RegularExpressionValidator ID="reg" runat="server" ControlToValidate="TextBox1" ErrorMessage="This character is not allowed" ValidationExpression="^[^*%']+$">
</asp:RegularExpressionValidator>



Mark as solved if it helps you.

Thanks,
KK
 
Share this answer
 
Comments
Rockstar_ 30-Apr-13 7:38am    
Thanks...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900