Nebojsa Veron
Nebojsa Veron

Reputation: 1615

ASP.NET MVC 2 DropDownList Selected item changed?

I have a drop down list on my aspx form and what I want is to refresh the site after I select an item from the list. This is my drop down list:

 <%: Html.DropDownListFor(x => x.CompanyUserFilterId, new SelectList(Model.CompanyUsers, "Id", "FirstName", Model.CompanyUserFilterId))%>

I use it to filter the data shown on the form depending on the selected item on the drop down list. Please help :)

Upvotes: 0

Views: 2069

Answers (2)

Kalle
Kalle

Reputation: 2293

The simplest method is probably to trigger an html/javascript onchange-event, and handle that to update your page (or post the form with the selected Id).

Take a look at this: http://blog.wekeroad.com/2008/10/21/asp-net-mvc-dropdownlist-and-html-attributes

Upvotes: 1

brianc
brianc

Reputation: 1629

you'll need to 'refresh' the site with some sort of client side mechanism onchange. A similar solution using JQuery is posted here.

Upvotes: 1

Related Questions