I'm currently developing a simple program (using ASP.Net C#) to populate data from GridView into Excel file. the Excel file will be need to downloaded into client computer.
For some reasons, I need to manipulate the Excel file quickly after it downloaded into client local computer.
The problem is I can't get the file location where the file was downloaded. How can I get the file location after it downloaded into client computer ?
This is the screenshot:
Download Code:
private void Create_ExcelContent2()
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=" + ddlBatchID.Text + ".xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw); ...
gvBatchSummary.RenderControl(hw);
string style = @"<style> .textmode { } </style>";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
}
}