I could name 2 solutions to these issues.
First, using the Cascading Drop Down from the AJAX Toolkit for ASP.NET pages. You have links and an example: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx This is somehow a cleaner , and it does not cause a postback, but you should use this toolkit. But itβs nice to learn how to use it, because it offers others pleasant amenities.
The second involves adding an OnSelectedIndexChange event handler for the DropDownList. Therefore, when the user selects a value from the first drop-down list, the server side catches this event and fills the second DropDown with the necessary values. Due to the fact that this requires server-side operations, it can be quite frustrating to reload the page after selection. The client side should look like this:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack = true OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList>
Where on the server side:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { DropDownList2.Items.Clear(); DropDownList2.Items.Add("text"); .... }
source share