I have two select lists, and I want the selection for both to go to one property in the Model.
<li>
@Html.DropDownListFor(model => model.Year, (SelectList)fiscalYearsList, "All Years", new { id = "fiscalYearsList", style= "display:none" })
</li>
<li>
@Html.DropDownListFor(model => model.Year, (SelectList)calendarYearsList, "All Years", new { id = "calendarYearsList" })
</li>
Then with Jquery I am toggling each whenever a radio button is selected. Is this possible to send just the selected item from the visible DropDownListFor to the model? It is开发者_开发技巧 not quite working at the moment. Only the first DropDownListFor actually gets sent to the model.
I ended up adding another property to my View Model and then adding a little extra logic to display the correct DropDownListFor with Javascript. Works fine.
精彩评论