I have a dropdownlisftFor that populate some data from the database that is filtered, and a checkbox. The idea is that, when i uncheck the checkbox, I want to change the data, that is populated in the dropdownbox, with the data of the database without the filter.
Which is the good approach to make this?
Suggested method would be to load your dropdown list as a separate action with a bool parameter of
filtered. you can call this in your view with@Html.Action("DropDownList", new {filtered = true})Then when you uncheck the check box call a function that replaces the dropdown with the action with unfiltered data.
This function will work for filtering and unfiltering the data in your list.