I have 3 classes with below definition
public class UserRole
{
public User User { get; set; }
public IEnumerable<Role> Role { get; set; }
}
public class Role
{
public int Id{ get; set; }
public string RoleName{ get; set; }
}
public class User
{
public int Id{ get; set; }
public string UserName{ get; set; }
}
This is the action method:
// GET: /Admin/UserManagement/Create
[HttpPost]
[Transaction]
public ActionResult Save(UserRole userrole)
{
}
Is there a way in Jquery to serialize some JavaScript vars into a class Obj and then send it to an MVC controller action via an AJAX post?