I am using jquery choose multiple dropdownlist.
I have multiple values from selected dropdownlist.
Html:
@using (Html.BeginForm()) {
<div class="editor-field" style="width:150px;">
@Html.DropDownList("UserRole", null, new { @class = "chosen-select",@multiple="multiple",@placeholder="Lütfen Rol Seçiniz",@style="width:250px;"})
</div>
<input type="submit" value="Create" />
}
When i click to create button button submits to below actionresult
[HttpPost]
public ActionResult AddUser(List<UserRole> UserRole)
{
return view();
}
UserRole is always null when i post it
UserRole Class properties below
public int UserRoleID { get; set; }
public Nullable<int> FirmUserID { get; set; }
public Nullable<int> RoleID { get; set; }
Where i miss how can i get selected all values in multiple dropdownlist ?
Any help will be appreciated.
Thanks.