Javascript Dual Listboxes in ASP.Net

During the migration of an ASP.Net project to version 2.0 I was looking for a dual listbox control with Javascript support.

Unfortunately, a lot of “hits” led into dead ends and product listings of things long removed from the web.

Then I found the MetaBuilders WebControls collection on CodePlex, which you just need to download and compile. Then add a reference to the DLL in your project, and add the DLL in your component toolbox.

Compiling the latest version (Change Set 15894 of March 6, 2008) in Visual Studio 2005 required a bit of editing though:

First, VS could not open the project, however changing the first line of the .sln file from

Microsoft Visual Studio Solution File, Format Version 10.00


Microsoft Visual Studio Solution File, Format Version 9.00

fixed that.

Next, the PollViewDesigner.cs raised an error with an inline initialization of a List object. Since I didn’t need a Poll control, I simply commented out the offending code, compiled the solution, and was ready to use it in my project.

I noticed that the DualList’s behavior differs depending on the value of AutoPostBack.

If AutoPostBack is false, you can move list entries by double-clicking them. If AutoPostBack is true, moving only works by clicking the buttons.

Since some items should always be selected items, I wanted to check the unselected items in the ItemsMoved event, and re-select them if required. Without AutoPostBack, I have to check them in response to an action button instead.

One Response to Javascript Dual Listboxes in ASP.Net

  1. […] Listboxes in ASP.Net using Ajax Extenders I wrote an article about a Javascript Dual Listbox some time ago. Recently I needed this functionality again, searched, and found the Dual List Box […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: