Search code examples
asp.netajaxtoolkittextboxextender

How can i filter out a comma in a TextBoxExtender in ASP.NET AJAX Toolkit?


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" />
    

    Reference

    EDIT no you can just add all your characters you want to exclude

    InvalidChars="`~!@#$%^&*()_-+=[]{}:;',.<>/? "