0
好日子每個人,我使用MvcJqGrid(https://github.com/robinvanderknaap/MvcJqGrid)來顯示我的數據在我的項目。我想通過jquery post傳遞當前的jqgrid設置,但我無法在動作控制器中獲取它。看起來我錯過了GridModelBinder的一些東西。你能告訴我我在做什麼錯在這裏..感謝返回mvcjqgrid gridsettings到行動控制器通過jquery後不工作
這是我的javascript代碼:
function Export() {
var data = $("#ReportGrid").getGridParam("postData");
$.post('/Home/ExporttoExcel', { gridSettings: data, moduleID: 3 });
}
,這是我的動作控制器:
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");
}