Dual 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 Extender.

What’s the difference?

The MetaBuilders control library generates the list boxes and buttons using ASP.Net controls, and adds selection logic in Javascript.

The (support) downside is that the last update of the project is from September 2007, and the latest answer to a “discussion” entry is from July 2009, a year ago.

The Dual List Box Extender is just that: it uses the MS Ajax Extender mechanism (MSDN library, magazine, blog) to add dual listbox functionality to a single listbox.

What the extender’s Javascript does is to hide the original listbox, dynamically create two new listboxes and necessary buttons, and copy the listbox contents to the newly created listboxes according to the items’ Selected flag.

Moving the item between the two lists automatically sets the Selected flag accordingly, thus supporting compatible behavior in postbacks.

The layout of the dual listbox controls can be freely defined using CSS.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: