HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}.xlsx", HttpUtility.UrlEncode(strFileName, Encoding.UTF8))); HttpContext.Current.Response.ContentEncoding = Encoding.UTF8; HttpContext.Current.Response.Buffer = true; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.BinaryWrite(pck.GetAsByteArray()); //HttpContext.Current.ApplicationInstance.CompleteRequest(); HttpContext.Current.Response.End();
Click Export abnormal way not to call, click to change the trigger event (EnableAjax = "false") || href = "method."