I am using a jquery mobile for mobile application, and I try to reuse as much as possible of the original desktop app. So, one of my pagers has ajax links and uses HttpPost PartialViewResult method.
I have two methods that are named the same way, but one is HttpPost and second one is regular. When I debug with firebug I see that all the links in the pager are being sent with HttpGet even though I specify the post type. Code for ajax options:
var ajaxOptions = new AjaxOptions {
UpdateTargetId = "productList",
HttpMethod = "POST",
OnBegin = "beginPaging",
OnSuccess = "endPaging",
OnFailure = "errorPaging"
};
Basically my questions is, why ajax calls are always GET, and how can I change that. Thank you. I am using MVC3 if it helps.
You probably forgot to include the
jquery.unobtrusive-ajax.jsscript to your page. This script unobtrusively AJAXifies anchors and forms generated with the Ajax.* helpers.