How Can I Send List<int>
Roles Model? For example from view To Controller.
Using Ajax Jquery in Mvc3 asp.net not razor.
I'm using this code
var url = '<%:Url.Action("Roles","RolesManager") %>';
$.ajax({
url: url,
type: 'post',
dataType: "json",
traditional: true,
data: $('#EditUserForm').serialize(),
success: function () {
$('#EditUserForm').submit();
},
error: function () {
}
});
but when I debug the controller List<int> Roles = null
.
mode in page like
<%: Html.ListBoxFor(m => m.UserRoles, new MultiSelectList(Model.UserRoles, "UserRoleId", "UserRoleName"), new { @id = "UserRoles", @class = "ddlUserRolesCls" })%>