How can i filter out a comma in a TextBoxExtender in ASP.NET AJAX Toolkit?
-
20-08-2019 - |
Question
I want my TextBoxExtender to NOT allow a comma and a slash. How do I set it ? Using an escape sequence ?
Thanks.
Solution
I think you are looking for the InvalidChars Element. The FilteredTextBoxExtender can be set to filter either Valid or Invalid Characters.
<ajaxToolkit:FilteredTextBoxExtender ID="MyId" runat="server"
TargetControlID="TextBoxName"
FilterType="Custom"
FilterMode="InvalidChars"
InvalidChars="Your Charcters" />
EDIT no you can just add all your characters you want to exclude
InvalidChars="`~!@#$%^&*()_-+=[]{}:;',.<>/? "
OTHER TIPS
Yes , but i also wanted to know how to include a comma in the set - it needs an escape sequence right ? Like Invalidchars="H,\,".
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow