i have gridview and export to excel button inside Update panel, the code i am using to export gridview data to excel is..
but nothing is happening plz help me
public void imgExcelExport_Click(object sender, ImageClickEventArgs e)
{
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Customers.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gridName.AllowPaging = false; gridName.DataBind();
gridName.HeaderRow.Style.Add("background-color", "#FFFFFF");
gridName.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}