C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

ListSearchExtender Control - ASP.NET


Posted Date: 23 Jun 2009    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 7



In this Article we can see the usage of ListSearchExtender Control.

The control ListSearchExtender is a control available in AJAX Control Kit.


What is ListSearchExtender?


As the name indicates ,this control is used to extend the searchable features of web controls like DropdownList and ListBox in ASP.Net.

Usage of ListSearchExtender


The controls Dropdownlist and Listbox are used to list the various items collection.


If the number of items in the list box/Dropdownlist is more, we may want to highlight the items by typing the name of the few characters of the item.


This searchable feature in DropdownList and ListBox is accomplished with the help of ListSearchExtender.



Searchable Feature using JavaScript:


We can also Write JavaScript Code to Handle this.



And we have to Write Function FindItemInList()


But Without writing any code, we can achieve the searchable feature in Listbox and Dropdownlist.


Prerequisites:


* Ajax Control Toolkit

* Drag and Drop ListSearchExtender Control in the Page.

* Set the TargetControlID property of the ListSearchExtender to the name of ListBox or DropDownList.

* Remaining will be taken by ListSearchExtender Control


Example




/* Add DropDownList Control */

< asp:DropDownList ID="DropDownList1" runat="server" >
< /asp:DropDownList >


/* Add ListSearchExtender Control */

/* Set TargetControlID Property to DropDownList1 (Name of DropDownlist) */


< cc1:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="DropDownList1" >
< /cc1:ListSearchExtender >


/* Add ListBox Control */

< asp:ListBox ID="ListBox1" runat="server" >< /asp:ListBox >


/* Add ListSearchExtender Control */

/* Set TargetControlID Property to ListBox1 (Name of ListBox) */

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




/* Dropdownlist Population */

Public Sub PopulateDropDownList ()

'Populate Some items

DropDownList1.Items.Add ("Arabic")

DropDownList1.Items.Add ("English")

DropDownList1.Items.Add ("Tamil")


End Sub


/* ListBox Population */

Public Sub PopulateListBox ()

'Populate Some items

ListBox1.Items.Add ("Arabic")

ListBox1.Items.Add ("English")

ListBox1.Items.Add ("Tamil")


End Sub





Benefits

1. No need to write code to handle searching

2. No Postback as it is based on AJAX concept.

3. Easy to use in pages



Just type in the listbox or dropdownlist the name of the item you want to search, it will highlight the items if it is available in the list







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
ListSearchExtender Control - ASP.NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: ASP.NET MVC Action filters
Previous Resource: Encrypt Query String using c# and HttpModule
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use