---
title: "Ajax Toolkit FilteredTextBoxExtender Control in ASP.Net"  
description: "FilteredTextBox is an extender which prevents a user from entering invalid characters into a text box.  FilteredTextBox Properties:TargetControlID - T"  
author: "Amit Singh"  
published: 2010-12-07  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/266/ajax-toolkit-filteredtextboxextender-control-in-asp-dot-net  
category: "ajax"  
tags: ["ajax"]  
reading_time: 2 minutes  

---

# Ajax Toolkit FilteredTextBoxExtender Control in ASP.Net

FilteredTextBox is an extender which prevents a user from entering invalid characters into a text box.\

## FilteredTextBox Properties:

· **TargetControlID -** The ID of the text box for this extender to operate on

· **FilterType-** Is applying type of Filter, as a comma-separated combination of Numbers, LowercaseLetters, UppercaseLetters, and Custom

· **FilterMode -** It contain ValidChars or InvalidChars.

· **ValidChars -** A string consisting of all characters considered valid for the text field, if "Custom" is specified as the filter type.

· **InvalidChars -** A string consisting of all characters considered invalid for the text field, if "Custom" is specified as the filter type and "InvalidChars" as the filter mode.

· **FilterInterval -** An integer containing the interval (in milliseconds) in which the field's contents are filtered.

## Code:

```
 <%-- ScriptManager control manages client script for AJAX enabled ASP.NET pages.This enables partial-page rendering and Web-service calls.You have to used this if you want to use ajax control toolkit--%><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <%--Use the FilteredTextBox Extender here which control the textbox1--%><cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TextBox1" FilterType="Numbers"></cc1:FilteredTextBoxExtender>  <asp:Label ID="Label1" runat="server" Text="Only Number allowed"></asp:Label> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> <%--Use the FilteredTextBox Extender here which control the textbox2--%>  <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="TextBox2" FilterType="LowercaseLetters"></cc1:FilteredTextBoxExtender><asp:Label ID="Label2"runat="server" Text="Only valid LowercaseLetters "> </asp:Label><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
```

**Run the project**

![AjaxControl Toolkit FilteredTextBoxExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/b958ce33-41b8-4661-b1a9-3fd9c023ca84/images/5ddff93f-daaf-4a0d-9513-d958adabcedb.png)

In FilteredTextBoxExtender1 filtertype is specified number(FilterType="**Numbers**") so first textbox accept only number

In FilteredTextBoxExtender2 filtertype is specified lowercaseletter (FilterType="**LowercaseLetters**") so second textbox accept only lowercase letter.

![AjaxControl Toolkit FilteredTextBoxExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/b958ce33-41b8-4661-b1a9-3fd9c023ca84/images/5ddff93f-daaf-4a0d-9513-d958adabcedb.png)

---

Original Source: https://www.mindstick.com/articles/266/ajax-toolkit-filteredtextboxextender-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
