Q
Q. John Chen
This is another one I posted at asp.net group a while ago.
I use following code to export the grid to Excel:
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new
System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);
this.ClearControls(dgDispatch);
dgDispatch.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
It works fine until -- I opened TWO IEs:
I start the first browser, query the database and then render the grid.
Fine.
I start the second browser, did a different query. then render the
grid. But it shows the result of the first browser. And more
interestingly, the content in the first browser is gone (Moved to the
second browser).
I tried give it a file name, tried set the expiration. But nothing
worked.
CLUE?
Thanks in advance.
John
I use following code to export the grid to Excel:
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new
System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);
this.ClearControls(dgDispatch);
dgDispatch.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
It works fine until -- I opened TWO IEs:
I start the first browser, query the database and then render the grid.
Fine.
I start the second browser, did a different query. then render the
grid. But it shows the result of the first browser. And more
interestingly, the content in the first browser is gone (Moved to the
second browser).
I tried give it a file name, tried set the expiration. But nothing
worked.
CLUE?
Thanks in advance.
John