ajax+jquery+NPOI导不出数据,在线等。。。
页面上导出按钮点击是触发的javascript方法:
function ExportData() { $.ajax({ type: "post", url: "../_Ajax/AjaxCountBase1.ashx", data: 'op=Export', dataType: "text", cache: false, success: function () { }, error: function (message) { LG.showError(message); //$.ligerDialog.tip({ title: '提示信息', content: '导出失败' }); } }); }
protected void ExportExcel(HttpContext context) { if (ExportDataTable != null) { ExcelRender.RenderToExcel( ExportDataTable, context, "统计.xls"); } }
function ExportData() {window.location='../_Ajax/AjaxCountBase1.ashx?op=Export'///////// /* $.ajax({ type: "post", url: "../_Ajax/AjaxCountBase1.ashx", data: 'op=Export', dataType: "text", cache: false, success: function () { }, error: function (message) { LG.showError(message); //$.ligerDialog.tip({ title: '提示信息', content: '导出失败' }); } });*/ }