私はMVCアプリケーションでWebGridを使用しています。ページングには、このコードを使用しています。
var links = $('a[href*=page], a[href*=sort]');
form = $('form')[0];
links.click(function () {
debugger;
form.attr("action", this.href);
$(this).attr("href", "javascript:");
form.submit();
});
@using (Html.BeginForm(Model.PostToAction, "Leads", FormMethod.Post))
form.submit()が実行されると、POSTではなくGETとして実行されます。
私は何を間違っているのですか?
アップデート:
私のフォームは:
<form action="/Leads/DetailsLeads" method="post">
コントローラーは:
[HttpPost]
public ActionResult DetailsLeads(LeadDetailsViewModel model)