In doing an autorefresh by putting the following code,i assumed that when i do a post the model will automatically sent to the controller ,
$.ajax({
url: '<%=Url.Action("ModelPage")%>',
type: "POST",
//data: ??????
success: function(result) {
$("div#updatePane").html(result);
},
complete: function() {
$('form').onsubmit({ preventDefault: function() { } });
}
});
in every post i need to increment the value attr in the model every time there is a post
public ActionResult Modelpage(MyModel model)
{
model.value = model.value+1;
return PartialView("ModelPartialView", this.ViewData);
}
but the model is not passed to the controller when the page is posted with jquery ajax() request , how can i send the model in the ajax request ??