MVC Webapi get method passing model as parameter
I am using mvc4 webapi, I want to know how to make ajax call that passes a
model as the parameter to a Get Method. I am getting model null on Get
method.
//Controller
public HttpResponseMessage GetUsersList(ProfileModel objProfileModel)
{
}
//Jquery Ajax
function GetUsersList()
{
$.ajax({
type: 'POST',
url: '/api/SearchWebApi/GetUsersList',
data: $("#frmsearch").serialize(),
success: function (data)
{
},
error: function (xhr, textStatus, errorThrown)
{
//window.location = JsErrorAction;
},
dataType: "json"
});
return false;
}
No comments:
Post a Comment