Post data to the action result in jqGrid and ASP.NET MVC

Below example shows how to postdata from the jQGrid to ASP.NET MVC ActionResut when dropdown change

Script


$(".selectRequestType").change(function () {
$('#jqgRequests').setGridParam({ postData: { FilterValue: $(this).val() } }).trigger('reloadGrid', [{ page: 1 }]);
});

Action Result


[AcceptVerbs(HttpVerbs.Post)]
public JsonResult LoadRequest(JqGridRequest request, PostDataViewModel postData)
{
}

public class PostDataViewModel
{
public string FilterValue { get; set; }
}