How to refresh dropdownlist without reloading the page?

Use AJAX. Place both dropdown controls in UpdatePanel and just after the opening Form tag in the page add a ScriptManager (if not already there)


If this is the case, Ajax method should resolve your problem. Since you are quite new to Ajax, I would describe a bit more details.

  1. There must be only one ScriptManager in the same page. ( If you are using Master page, add to master page and no need to add anymore in nested content page )

  2. Add UpdatePanel and add your controls to ContentTemplate of UpdatePanel.

  3. Add AutoPostBack="True" to your main dropdownlist.

  4. Add SelectedIndexChanged event by double clicking on main dropdownlist.

  5. In SelectedIndexChanged event of main dropdownlist, clear the ddlDrillDown items by adding ddlDrillDown.Items.Clear() method and rebind the data whatever you need based on the value of main dropdown list.


You can use ajax for this goal.

Create asmx-service or webApi controller which return list of items. Call this on change and render it.

Tags:

C#

Asp.Net