Home > DeveloperSection > Beginner > Ajax Toolkit ListSearchExtender Control in ASP.Net

Ajax Toolkit ListSearchExtender Control in ASP.Net

0 Comment(s)
 10224  View(s)
Rate this:

Ajax Toolkit ListSearchExtender Control in ASP.Net

The ListSearchExtender lets you search for items in a ListBox or DropDownList. The extender performs an incremental search within the ListBox based on what has been typed so far.

ListSearchExtender Properties:

·         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 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 should be used in the search query. The default pattern queries for 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.


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


<%--Use the ListSearchExtender here which control the ListBox1--%>


<cc1:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ListBox1">



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







Here Item is added in ListBox.

Here TargetControlID is "ListBox1" this TextBox will be searchable.


Run the project


AjaxControl Toolkit ListSearchExtender Control in ASP.Net

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


Don't want to miss updates? Please click the below button!

Follow MindStick