The downloadable source project above uses the following technologies:
DropDownListChosen. The only requirement is to drag and drop the
DropDownListChosen control. The source code download contains the class library project for the
DropDownListChosen and a test website using the
Using the Code
To use the
DropDownListChosen, you will need to follow these steps:
- Include a project reference to the DropDownChosen.dll to your ASP.NET webforms project.
- You can skip steps 2 and 3 by using the
DropDownListChosen from your Visual Studio toolbox.
- To do so, be sure that you are currently editing a web page so that you can get access to the toolbox and ASP.NET controls.
- From your Visual Studio toolbox, right click to create a new tab or use an existing one to add the
DropDownListChosen. Start by right clicking in the toolbox and select "Choose Items.." and then browse to where you have saved the DropDownChosen.dll.
- Once added, you can now double click or click and drag the
DropDownListChosen to your web page to get started. This will automatically add the reference to your web project, place the proper code in the header of your web page, and add the control into your web page.
- Register the
DropDownListChosen at the top of your web page:
<%@ Register Assembly="DropDownChosen"
Namespace="CustomDropDown" TagPrefix="cc1" %>
- Add the
script tags for the
DropDownListChosen on your web page:
<cc1:DropDownListChosen ID="DropDownListChosen1" runat="server"
NoResultsText="No results match." width="350px"
DataPlaceHolder="Type Here..." AllowSingleDeselect="true">
- Bind items to your dropdown list either manually by adding
ListItems to the
DropDownListChosen or by binding to a
Datasource example can be found in the downloadable source code above.
You're done! You can now work with your
DropDownListChosen to find what options work best for you. I would love to hear some great feedback if you use this control on your site.
- 13th July, 2013: Tip published
- 7th August, 2013: Added
DataPlaceHolder property and removed style sheet that causes design problems
- 7th September, 2013: Added new properties