Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cannot download Excel File IN IE7 but it works in FireFoxCannot download Excel File IN IE7 but it works in FireFox
Previous
 
Next
New Post
12/24/2008 2:49 AM
 

Hi.

i have developed my custom module in which i can export the data in .CSV format.i can download the file in FireFOx but m getting problems in IE7.Below is my code

Response.Clear();
Response.AddHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0"); 
Response.AddHeader("Content-transfer-encoding", "binary"); 
Response.AddHeader("Pragma", "anytextexeptno-cache, true");
Response.AddHeader("Content-Disposition", "attachment; filename=" + orderfileName + ".csv");
Response.AddHeader("Content-Length", Convert.ToString(contents.Length));                    
Response.ContentType = "application/ms-excel";
Response.Write(contents);
Response.End();

When i click the "Export to Excel" button in my module i get following error.


Internet Explorer cannot download Default.aspx from www.emo.ie.

Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found.  Please try again later.

Any help would be greatly appreciated.

thanks.

 

 
New Post
12/24/2008 3:59 PM
 

Forgot to include Response.ClearHeaders()

 
New Post
3/12/2009 5:08 PM
 

i am facing the same problem, when application in "https"

Please post the solution if you have resolved this

 
New Post
3/12/2009 6:05 PM
 

 

Consider simplifying your code a bit.  Remove all of the headers and simply spit out the Content-Disposition and ContentType. 

Also consider changing ContentType to "application/unknown"  Instead of forcing it to excel allow for the client's default CSV handler to kick in...

Consider using Fiddler to watch the request.  I wonder if there is somthing in the buffer....


Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment; filename=" + orderfileName + ".csv");
Response.AddHeader("Content-Type", "application/unknown");
Response.Write(contents);
Response.End();

Also, is this in a DNN module or in a IHttpHandler ?

 

 
New Post
3/13/2009 9:11 AM
 

Thank you Rob Chartier.

the solution you provided works great

i am using this in DNN Module.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cannot download Excel File IN IE7 but it works in FireFoxCannot download Excel File IN IE7 but it works in FireFox


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out