How to Avoid Response.End() “Thread was being aborted” Exception during the Excel file download

后端 未结 16 2281
感动是毒
感动是毒 2020-11-27 11:47

I tried to convert my dataset into excel and download that excel .I got my required excel file.But System.Threading.ThreadAbortException was raised every excel download. Ho

16条回答
  •  借酒劲吻你
    2020-11-27 12:26

    For me it helped to register a button that calls code behind code as a postback control.

    protected void Page_Init(object sender, EventArgs e)
    {
        ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(btnMyExport);
    }
    

提交回复
热议问题