Link to home
Start Free TrialLog in
Avatar of canuckconsulting
canuckconsultingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Filter listbox contents client-side

I have a .Net web application created with c# using Visual Studio 2010.

On a web page a have a DropDownList containing containing a list of publishers.  Below that I have ListBox displaying books for the selected publisher.  I would like the list to update when the users selects a publisher in the DropDownList.  I can do this server-side but how can I do it client-side for quicker performance?
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

A link to the page would be helpful; or at the very least the HTML that the browser is seeing.

Cd&
Avatar of canuckconsulting

ASKER

It is something I am developing.  Just an asp:DropDownList  followed by an asp:ListBox.  If it helps it will look like:

          <asp:DropDownList ID="DropDownList1" runat="server">
              <asp:ListItem Value="1">Publisher 1</asp:ListItem>
              <asp:ListItem Value="2">Publisher 2</asp:ListItem>
          </asp:DropDownList>
      </p>
      <p>
          <asp:ListBox ID="ListBox1" runat="server">
              <asp:ListItem Value="1,1">Book1</asp:ListItem>
              <asp:ListItem Value="1,2">Book 2</asp:ListItem>
          </asp:ListBox>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help which worked fine.

In the end I used jquery and something similar to this do to the next requirement I had:

http://jquerybyexample.blogspot.com/2012/05/how-to-move-items-between-listbox-using.html