Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am developing a web application where i meet some custom requirements , that the text boxes would only accept
SQL
a to z and 0 to 9 and also allow these cahr
& " ; , . - # @ / {}



these characters and deny all other inputs...
how to make this regular expression ???
Posted

C#
var r = new System.Text.RegularExpressions.Regex("^[a-z0-9&\";,.\\-#@/{}]*$");
 
Share this answer
 
Please try FilteredTextBoxExtender
code like

XML
<ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server"
                                                                        FilterType="Numbers,Custom" TargetControlID="txtPrice" ValidChars=".">
                                                                    </ajaxToolkit:FilteredTextBoxExtender>



In valid char put all the valid character

Check this link[^] for help
 
Share this answer
 
v2

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