How to use Ajax FilteredTextBoxExtender control in OR Ajax FilteredTextBoxExtender Example - ASPMANTRA | Asp.Net,MVC,AngularJs,Jquery,Javascript,Sql Server AND WCF snippets and tutorial

How to use Ajax FilteredTextBoxExtender control in OR Ajax FilteredTextBoxExtender Example

Introduction: In this post I will explain how we can use the Ajax FilteredTextBoxExtender control in


FilteredTextBoxExtender used to prevent the user to enter invalid characters to Textbox. FilteredTextBoxExtender Properties:
TargetControlID: ID of Textbox for FilteredTextBoxExtender to operate on
FilterType: Filter type apply on Textbox, as a comma seprated combination of Numbers, Uppercase Letters, Lowercase Letters and Custom.
ValidChars: If Filtertype is Custom than use this property otherwise ignore.

Note: To make spaces between characters Example below given:
 FilterType="LowercaseLetters,Custom" ValidChars=" "

Add a web form to project. Drag and drop the control from Toolbox and design .aspx as mention below:

<asp:ScriptManager ID="ScriptManager1" runat="server">
        <tr><td style="font-size:18px; font-weight:bold">Ajax FilteredTextBoxExtender Example</td></tr>
        <tr><td><b>Numeric with *+-/() (Custom Example):</b></td><td><asp:TextBox ID="txtcustom" runat="server"></asp:TextBox><asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtcustom" FilterType="Custom,Numbers" ValidChars="+-=/*().">
        <tr><td><b>Enter Phone Number (Number Example)</b>:</td><td>
            <asp:TextBox ID="txtphone" runat="server"></asp:TextBox><asp:FilteredTextBoxExtender
                ID="FilteredTextBoxExtender2" runat="server" TargetControlID="txtphone" FilterType="Numbers">
        <tr><td><b>Enter Your First Name (Uppercase Example)</b>:</td><td>
            <asp:TextBox ID="txtname" runat="server"></asp:TextBox><asp:FilteredTextBoxExtender
                ID="FilteredTextBoxExtender3" runat="server" TargetControlID="txtname" FilterType="UppercaseLetters">
        <tr><td><b>Enter Your Last Name (Lowercase Example)</b>:</td><td>
            <asp:TextBox ID="txtlastname" runat="server"></asp:TextBox><asp:FilteredTextBoxExtender
                ID="FilteredTextBoxExtender4" runat="server" TargetControlID="txtlastname" FilterType="LowercaseLetters,Custom" ValidChars=" "

Run the project and check the result.

What do you think about this article?

If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.