How to change id value when using Html.DropDownListFor helper in asp.net mvc 2.0?
问题 I have a partial view that has something like this <%= Html.DropDownListFor(m => m.SelectedProductName, Model.ProductList, "Select a Product") %> Now you can create a new product and edit an existing product. Both editing and creating use the same form. The create is on the main page on load up. Edit pops up in a jQuery UI model dialog and renders a new partial view. So as far as the page is concerned I have 2 dropdown boxes with the same "id" which is bad since they should be unique. So how