---
title: "Ajax Toolkit ListSearchExtender Control in ASP.Net"  
description: "The ListSearchExtender lets you search for items in a ListBox or DropDownList. The extender performs an incremental search within the ListBox based on"  
author: "Pushpendra Singh"  
published: 2010-12-07  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/268/ajax-toolkit-listsearchextender-control-in-asp-dot-net  
category: "ajax"  
tags: ["ajax"]  
reading_time: 2 minutes  

---

# Ajax Toolkit ListSearchExtender Control in ASP.Net

The ListSearchExtender lets you search for items in a [ListBox](https://www.mindstick.com/articles/626/listbox-events-in-c-dot-net) or [DropDownList](https://www.mindstick.com/blog/33/dropdownlist-in-asp-dot-net). The extender performs an [incremental](https://www.mindstick.com/interview/23335/what-is-incremental-testing) search within the ListBox based on what has been typed so far.\

**ListSearchExtender [Properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule):**

· **PromptText** - Message to display when the ListBox or DropDownList is given focus. Default is 'Type to search'. The PromptText is replaced by the [search text](https://answers.mindstick.com/qa/95130/why-i-can-t-search-or-copy-the-text-in-a-pdf-file-and-how-can-i-enable-it-to-copy-or-search-text-from-pdf-for-free) typed by the user.

· **PromptCssClass** - The name of the CSS class to apply to the prompt message.

· **PromptPosition** - Indicates whether the message should appear at the Top or Bottom of the ListBox. The default is Top.

· **QueryPattern** - Indicates how the typed [characters](https://answers.mindstick.com/qa/42112/who-is-the-originator-of-avengers-characters) should be used in the [search query](https://www.mindstick.com/forum/160075/what-is-an-sql-search-query-and-how-is-it-different-from-a-regular-sql-query). The default pattern queries for [results](https://yourviews.mindstick.com/view/88282/boost-your-career-mindstick-technical-training-that-delivers-results) that start with the typed word.

· **IsSorted** - Indicates if items added to the List are expected to be sorted. The default is false. If set to true it allows the code to perform a faster search instead of having to determine the same before performing the search.

· **QueryTimeout** - Indicates whether the search query should be reset after the timeout if no match is found. The default is 0, meaning no auto reset behavior.

## 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--%><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <%--Use the ListSearchExtender here which control the ListBox1--%>  <cc1:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ListBox1"></cc1:ListSearchExtender>  <asp:Label ID="Label1" runat="server" Text="Click in ListBox and then write keyword to search"  ForeColor="#009933"></asp:Label><br /> <%--Add the listbox control and set the selection mode properties like multiple--%>  <asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple"><asp:ListItem>India</asp:ListItem><asp:ListItem>Pak</asp:ListItem><asp:ListItem>Usa</asp:ListItem><asp:ListItem>Aus</asp:ListItem><asp:ListItem>Eng</asp:ListItem></asp:ListBox>
```

Here Item is added in ListBox.

Here TargetControlID is "ListBox1" this [TextBox](https://www.mindstick.com/articles/320/textbox-control-in-vb-dot-net) will be searchable.

**Run the [project](https://yourviews.mindstick.com/story/1788/things-to-ensure-your-construction-project-is-successful)**

![AjaxControl Toolkit ListSearchExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/ba907bbf-2eed-48bc-ab75-19be8ab2972e/images/eb9b3b1b-fb41-4293-93c5-e7579a4647b7.png)

When you write anything then if written keyword matches to the List box Item then it will highlight the matches’ value.

![AjaxControl Toolkit ListSearchExtender Control in ASP.Net](https://www.mindstick.com/mindstickarticle/ba907bbf-2eed-48bc-ab75-19be8ab2972e/images/dc7ddd88-d24c-40ff-95a3-47a39bf5a77e.png)

---

Original Source: https://www.mindstick.com/articles/268/ajax-toolkit-listsearchextender-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
