How to Use Filtered TextBox Extender of AJAX in ASP.NET

May 30, 2014 0 Comments

FilteredTextBoxExtender enables you to apply filtering to a text box control that prevents certain characters from being inserted in the text box. For example, you can limit a text box to either enter only characters, or digit, or dates. This extender is different from ASP.NET validation controls as it prevents the users from entering invalid characters.

Lets take an simple example

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    Enter Number only:
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" />
        <asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID ="TextBox1" FilterType="Numbers">

Code Generate the following Output

How to Use Filtered TextBox Extender of AJAX in ASP.NET

For Lower case Letter Only Set 
For Upper Case Letter only
For Upper and Number

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google