G
Guest
I checked a few sites on exporting data from asp.net to excel and most of them point to the same source a
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317719 with some modifications
My code is in the block below. When I click save when the open/save message box pops up, the file is saved as the aspx page's name with .xls. However, when I open the file, the filename is the exact aspx page name with .aspx in MS Excel
Response.Buffer = true
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
this.EnableViewState = false
//Response.AddHeader("Content-Disposition", "filename=Data.xls;"); // set the filenam
Response.Write("something")
Response.End()
I tried to set the filename by Response.AddHeader. When I do a save, the filename is saved as the specified .xls. However, when I open the file from the open/save popup, the filename is still the aspx page's name
I am wondering what could be wrong and how to fix this
Thank you
Zud
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317719 with some modifications
My code is in the block below. When I click save when the open/save message box pops up, the file is saved as the aspx page's name with .xls. However, when I open the file, the filename is the exact aspx page name with .aspx in MS Excel
Response.Buffer = true
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
this.EnableViewState = false
//Response.AddHeader("Content-Disposition", "filename=Data.xls;"); // set the filenam
Response.Write("something")
Response.End()
I tried to set the filename by Response.AddHeader. When I do a save, the filename is saved as the specified .xls. However, when I open the file from the open/save popup, the filename is still the aspx page's name
I am wondering what could be wrong and how to fix this
Thank you
Zud