Exporting + page refersh issue in mozilla
<p>I am filtering records from my page,then refreshing the page and Clicking button export to excel. IT is redirecting me to to error page(only in mozilla:working in IE and chrome).Plz help.(ASP.net,c#)
Full Code :
 protected void btnExportToExcel_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["Data"] != null)
            {
                dsBNOrder = (DataSet)Session["Data"];
                if (dsBNOrder.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = new DataTable();
                    DataView dView = dsBNOrder.Tables[0].DefaultView;
                    dt = dView.ToTable(true, "Sr_No", "PO_Order", "certificate", "lab", "shape", "quantity", "Color", "clarity");
                    dt.Columns["Sr_No"].ColumnName = "#";
                    dt.Columns["PO_Order"].ColumnName = "Order";
                    dt.Columns["certificate"].ColumnName = "Cert";
                    dt.Columns["lab"].ColumnName = "Lab";
                    dt.Columns["shape"].ColumnName = "Shape";
                    dt.Columns["quantity"].ColumnName = "Carats";
                    dt.Columns["Color"].ColumnName = "Color";
                    dt.Columns["clarity"].ColumnName = "Clarity";</p>

<pre><code>                //DataView dView= 
                GridView gv = new GridView();
                gv.DataSource = dt;
                gv.RowDataBound += new GridViewRowEventHandler(BNPackingExcelDataBound);
                gv.DataBind();
                Response.Clear();
                Response.Buffer = true;
                Response.Charset = "utf-8";
                Response.ContentEncoding = System.Text.Encoding.GetEncoding("windows-1250");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.ContentType = "application/vnd.ms-excel";
                Response.AddHeader("content-disposition", "attachment;filename=BN_Sales.xls");
                Response.Charset = "";
                System.IO.StringWriter sw = new System.IO.StringWriter();
                System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
                gv.RenderControl(htw);
                Response.Write(sw.ToString());
                Response.End();
            }
            else
            {
                if (Convert.ToString(Session["CheckRefreshBNPacking"]) == CheckRefreshBNPacking.Value.ToString())
                {
                    String script = String.Format("alert('No Records To Export To Excel');");
                    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "redirect", script, true);
                    Session["CheckRefreshBNPacking"] = Server.UrlDecode(System.DateTime.Now.ToString());
                }
                else
                {
                    txtdateFrom.Text = String.Empty;
                    txtToDate.Text = String.Empty;
                    LoadGrid();
                }
            }
        }
    }
    catch (System.Threading.ThreadAbortException lException)
    {
    }
    catch (Exception ex)
    {
        DiaErrorHandling.LogApplicationErrorInDB(ex, "BN Packing ExportToExcel", "WebForms_DiaBNPackingSlip.aspx", "btnExportToExcel_Click");
    }
}
</code></pre>
