Good Day Everyone, I'm using MvcJqGrid(https://github.com/robinvanderknaap/MvcJqGrid) to display my data in my project. I'm trying to pass the current jqgrid settings by jquery post, but i am not able to get it in the action controller. it seems I'm missing something for the GridModelBinder. can you tell me what am i doing wrong here.. thanks
This is my javascript code:
function Export() {
var data = $("#ReportGrid").getGridParam("postData");
$.post('/Home/ExporttoExcel', { gridSettings: data, moduleID: 3 });
}
and this is my action controller:
public FileContentResult ExporttoExcel(GridSettings gridSettings, Int32 moduleID = 0)
{
///Do something with the gridsettings value here.
var encoding = new ASCIIEncoding();
var fileContent = encoding.GetBytes(file.ToString());
return File(fileContent, "application/ms-excel", "List.xls");
}