Hi everybody,
I'm facing with the following problem (bug ?) :
A page is calling another one (export.aspx) for exporting data to
excel.
The tecnhique used is to create a Excel-MIME stream for viewing it
directly in the browser.
(below is a sample code)
When the page is called from IE6 (6.0, sp1...) the Page_Load is fired
twice and the second time a new session is created ;
and of course, I've lost all my session variables...
When the page is called from IE5.5, everything is OK.
I've tried several "tricks" with no success : suppress the frames from
the caller page, open the export.aspx in a new window,
move the code from Page_Load to Page_PreRender...
[I've read some similar behaviour with PDF.]
If a attach a file with :
Response.AddHeader("content-disposition", "attachment;
filename=MyFile.xls");
it's Ok, but the dialog (Open, Save...) is displayed, and I don't want
this.
W2K, Framework 1.1, IE6.0sp1, Office 2000
Any help will be appreciated.
-------
private void Page_Load(object sender, System.EventArgs e)
{
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
Response.Write("<TABLE><TR><TD>This should appear in
Excel</TD></TR></TABLE>");
Response.End();
}