everytime i click on the export to excel button the excel file is generated but my button my web app are disabled and i have no other option but to refresh the page manually.
protected void ImgExcel_Click(object sender, ImageClickEventArgs e)
{
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment;filename=Employee Data" + DateTime.Now.ToString("dd-MMM-yyyy") + ".xls");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
HtmlForm form = new HtmlForm();
gvShowData.Parent.Controls.Add(form);
form.Attributes["runat"] = "server";
form.Controls.Add(gvShowData);
form.RenderControl(htw);
Response.Write(sw);
Response.Flush();
Response.End();
}