I have a DropDownListFor and ListBox as defined below in my Razor view.
@Html.DropDownListFor(m => m.drpid, new SelectList(Model.List,"value","text",Model.DDselected))
@Html.ListBox("lstid", new MultiSelectList(Model.List2,"value","text",Model.LBselected))
Now when the dropdown value is changed i want to listbox item to be updated accordingly.
I have used change function of jQuery as below
$("#drpid").change(function() { ........ }
Now in this change function I want to assign the values present inside array (1,2,3) to be selected in ListBox and I am unable to do so. Could you please help me in updating/resetting the ListBox values using jQuery/javascript in this change function.