473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP Net IE6 - export data to Excel - Page_Load twice and new session fired

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();
}
Jul 21 '05 #1
0 4741

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: frankvfox | last post by:
I need a code sample using VB ASP.Net 2003 which exports a tab delimited text file resident on the server into an Excel spreadsheet which will be saved through the browser to the client's local...
1
by: | last post by:
The following code: Private Sub ClearControls(ByVal ctrl As Control) Dim i As Int32 For i = ctrl.Controls.Count - 1 To 0 Step -1 ClearControls(ctrl.Controls(i))
0
by: LouV | last post by:
The code below exports a datagrid from a dataset stored in a session variable without a hitch. It prompts the user if they would like to open or save the exported spreadsheet. But when the user...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
0
by: Funbeat | last post by:
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...
2
by: John Walker | last post by:
Hello, Below is my code for exporting a datagrid to Excel. It works fine, but we're going to need to somehow have a report header, user input parameters and system date display at the top of the...
2
by: John Walker | last post by:
Hello, Below is my code for exporting a datagrid to Excel. It works fine, but we're hoping to format the output as well - setting the font size and type, and giving each column a specific width,...
2
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.