Render to Excel - only one excel instance

Discussion in 'ASP .Net Datagrid Control' started by Q. John Chen, Aug 28, 2006.

  1. Q. John Chen

    Q. John Chen Guest

    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
    Q. John Chen, Aug 28, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lau Lei Cheong

    Page.Render do not render complete page

    Lau Lei Cheong, May 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,047
    Lau Lei Cheong
    May 15, 2004
  2. Bryan Ax
    Replies:
    5
    Views:
    1,569
    Bryan Ax
    Jun 2, 2004
  3. Chameleon

    only one instance

    Chameleon, Oct 30, 2005, in forum: Java
    Replies:
    2
    Views:
    1,383
    steve
    Oct 30, 2005
  4. Dejan Vesic
    Replies:
    0
    Views:
    157
    Dejan Vesic
    Aug 20, 2003
  5. Glenn Gillen
    Replies:
    0
    Views:
    262
    Glenn Gillen
    Nov 17, 2006
Loading...

Share This Page