Total Pageviews

Friday, March 22, 2013

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

Here when a dropdown change the filter value (what we are selected ) will pass to the action result

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; }
    }


No comments:

Post a Comment