Hi,
ASP.Net does not shows Save As dialogue box while converting Datgrid into Excel/Pdf.
My code has no errors. It Doesn't do anything.
I am using this code:
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=Sample.xls");
Response.ContentType = "application/vnd.ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new HtmlTextWriter(sw);
dg.DataSource = dmpset;
dg.DataBind();
dg.RenderControl(htw);
//GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
Please anyone knows helps me.
Thanks in advance...