Hi, I'm trying to create an xls files using c# like this
protected void ExportToExcel(DataSet dset, int TableIndex, HttpResponse Respone, string Felename)
{
Respone.Clear();
Respone.Charset = "";
Respone.ContentType = "application/vnd.ms-excel";
Respone.AddHeader("content-disposition", "attachment; filename=" + Felename + ".xls");
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(sw);
GridView gv = new GridView();
gv.DataSource = dset.Tables[TableIndex];
gv.DataBind();
gv.RenderControl(hw);
Respone.Write(sw.ToString());
Respone.End();
}
It is working fine for me. But it is opening that created xls file after successfull completion. But i want to save the file in my folder without opening and asking my permision.
How can i save automatically..
Thanks in advance