Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Render to Excel - only one excel instance

Reply
Thread Tools

Render to Excel - only one excel instance

 
 
Q. John Chen
Guest
Posts: n/a
 
      08-28-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to generate a user instance of SQL Server. Only an integratedconnection can generate a user instance. Harlan Messinger ASP .Net 2 03-28-2010 06:51 PM
Accessing rails render method outside of view / Decorating render Glenn Gillen Ruby 0 11-17-2006 02:30 PM
Limit Thunderbird to only one instance running at a time? Z Firefox 2 05-02-2005 09:01 AM
Page.Render do not render complete page Lau Lei Cheong ASP .Net 1 05-15-2004 04:10 AM
Custom controls instance problem on PostBack - two controls, one instance ??? Dejan Vesic ASP .Net Web Controls 0 08-20-2003 02:43 PM



Advertisments