Monday, March 26, 2012

updating dropdown list

if i have 2 dropdown list

first dropdown show typeGame from database

the other show the game name that's in choosen type from other database

how can i do?

thank you

Hi,

and welcome to the ASP.NET forums.

You just have to set the AutoPostBack="true" property of the first DropDownList control. In the SelectedIndexChanged event of that control you can capture the selected value and with that value you can access the other database and pass it in as key (most likely a foreign key) to retrieve the data you want.

Grz, Kris.


Since you are posting in the AJAX thread I assume you want to update the drop down lists client side, without requiring a page postback? Check out the CascadingDropDown which is part of the AJAXControlToolkit.

So you will need to download and install the AJAX RC and the AJAX Control Toolkit, both of which can be found here:http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

Here is a link that explains how to use the CascadingDropDown to pull from a database:http://ajax.asp.net/ajaxtoolkit/Walkthrough/CCDWithDB.aspx.

No comments:

Post a Comment