send full model to controller using $.ajax() in MVC

Posted by Ganeshjoshi under ASP.NET on 5/29/2013 | Points: 10 | Views : 2846 | Status : [Member] | Replies : 0
i want to insert model's properties using view and then want to send it to controller using jquery ajax. how can i send full model to controller using $.ajax()

my model is:
public class EmployeeDetail
public int EmployeeID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public int PhoneType { get; set; }
public string PhoneNumber { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
and i have a method on controller:
public void InsertDetail(EmployeeDetail emp)
EmployeeDetail empvalue = emp;

I want correct way to send full model to controller
url: '/Test/InsertDetail',
type: 'POST',
data: {
i get null in the method InsertDetail after this ajax post how to improve it

Thanks & Regards


(No response found.)

Login to post response