narasiman rao

narasiman rao

  • NA
  • 519
  • 769k

how to show popup when downloading the excel file

May 4 2016 9:05 AM
 
 i  am exporting the gridview data to excel.
 
before it downloading i want to show the popup. for that how can i do using C#
 
My code as follows with out popup code
 
System.Threading.Thread.Sleep(3000);
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvEmpdetails.AllowPaging = false;
BindGrid();
//Applying stlye to gridview header cells
for (int i = 0; i < gvEmpdetails.HeaderRow.Cells.Count; i++)
gvEmpdetails.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
gvEmpdetails.RenderControl(htw);
Session["ResponseData"] = sw.ToString();
iframe1.Attributes.Add("src", "Download.aspx");
 
 
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Employee.xls"));
Response.ContentType = "application/ms-excel";
string responseString = Session["ResponseData"] + "";
Response.Write(responseString);
Response.End();
 
from the above i want to add popup code before it is downloading to excel.
 
for that how can i do in asp.net using C#.
 
 
 
 
 

Answers (1)