Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9077959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:30:10+00:00 2026-06-16T19:30:10+00:00

I have an ASP.NET (webforms) page that renders MS-Excel back to the response stream

  • 0

I have an ASP.NET (webforms) page that renders MS-Excel back to the response stream on click of a button. Everything works perfectly in testing but on live deployment, I get this dialogue box after the browser appears to be trying to download the file:
enter image description here
where ReportsShow.aspx is the name of the aspx page that generates and renders the excel.
The button that triggers the download fires a postback so I am confounded as to why the page would not be found when it renders correctly on load?
I am clueless and any help would be greatly appreciated

EDIT: As requested by Mayank, here’s the code structure:

        // Get instance of reporting service
        IReportingService reportingServiceClient = Reports.GetWebService();
        // Get a fresh copy of the report
        BusinessReport theReport = reportingServiceClient.GetReport(AcctList.ToArray());

        ExcelExport excelExport = new ExcelExport();

        const string templateFileName = "Business-Report.xls";
        string newFileName = String.Empty;

        try
        {
            newFileName = excelExport.CopyTemplateFile(Server.MapPath("~/ExportTemplates/" + templateFileName));
            excelExport.WriteData(forexOptionReport, newFileName);

            Response.Clear();

            Response.AddHeader("content-disposition", string.Format("Attachment; filename=\"{0}\"", "Business-Report" + ".xls"));
            Response.ContentType = "application/vnd.ms-excel";

            Response.TransmitFile(newFileName);
            Response.Flush();
        }
        catch (Exception ex)
        {
            Errors.LogException("Error in Reports.BtnDownloadToExcel_Click", ex);
            throw;
        }
        finally
        {
            if (!String.IsNullOrEmpty(newFileName))
            {
                excelExport.DeleteFile(newFileName);
            }
        }

MORE INFO

I’ve analyzed this with fiddler and this is what I see for the particular request/response which is expected to present the excel for download:

enter image description here

This Stackoverflow Q/A states that the meaning of the forbidden icon is that the client is terminating/aborting the response

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:30:11+00:00Added an answer on June 16, 2026 at 7:30 pm

    I have found the solution to this issue. The details are as described in this link

    This SO question has some details and resources that would clarify what was happening.
    The basic issue is that IE versions 8 and below fail to download files over SSL when they see the following headers in the response:
    Cache-control: no-cache
    Pragma: no-cache

    These headers should be removed and replaced with:

    Response.Headers.Set("Cache-Control", "private, max-age=0");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ObjectDataSource on an ASP.NET WebForms page, that also has a data-bound
I have an ASP.net WebForms page that has a lot of content on the
I have a asp.net webforms page in which I'm using the jqGrid component. The
I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a
I have a ASP.NET Webforms application that is being used with Motorola Tablets (Android
We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working
I am working on an ASP.NET webforms page that has the following asp markup
I have a gradient background that I'm using like follows in an ASP.Net Webforms
I have an asp.net page that is trying to access a SSRS 2008 ReportServer
I have an ASP.Net webforms application that uses the .Net globalization features to deliver

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.