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 5952495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:41:24+00:00 2026-05-22T17:41:24+00:00

Internet explorer used to prompt a user to download an excel file after doing

  • 0

Internet explorer used to prompt a user to download an excel file after doing a Response.Write

Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("Content-Disposition", "attachment;filename=\"sheet.xls\"");
            Response.RedirectLocation = "export.xls";
            Response.Charset = "";
EnableViewState = false;

            System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);

            dataGridResult.RenderControl(oHtmlTextWriter);
            Response.Write(oStringWriter.ToString());

This works when I POST back to a page with a button click event.

I am using a page as a service and doing a $.get(), but the results are sent back as HTML. I am not prompted to open the excel file. How can send the prompt out to the user?

$.get('ExcelService.aspx',
                        { batches: input },
                        function (data) {
                            alert(data);//I see HTML
                        });
  • 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-05-22T17:41:25+00:00Added an answer on May 22, 2026 at 5:41 pm

    This is a similar thread, with a similar problem (“I would like to make an async GET request that returns back a document with MIME content type and cause it to bring the browser’s ‘Save’ dialog.”)

    How to specify content-type and content-disposition with $.ajax() GET response

    Someone there offers a workaround to it:

    If you’d like to programatically pop a save dialog box, you can use jQuery to append a hidden iframe to the page with the URL as it’s src. This should pop the dialog box as necessary.


    SAMPLE
    jquery – on click (dont need ajax/get)

                var dynamicUrl = 'ExcelService.aspx?batches=' + input;
                $('#excelPopup').attr('src', dynamicUrl);
                window.frames["#excelPopup"].location.reload();
    

    HTML

    <iframe id="excelPopup" style="visibility:hidden;height:0px;width:0px;"></iframe>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so I'm getting this weird unexpected response from Internet Explorer, while testing file
I have used raphael js for drwaing my flowchart in internet explorer 8. Now
I have noticed that Internet Explorer, which is used by the Web Browser component,
internet-explorer aborts the EOT file loading progress sometimes, so the font does not load
Internet explorer seems to be hang after you tab through form inputs while holding
In Internet Explorer I was testing some things with Privacy security settings. After finishing
Possible Duplicate: <blink> tag in Internet Explorer Hai I have used blink tag to
I have a strange problem in my application with Seam (2.1) and Internet explorer.
I am working on one application, i am facing one problem on Internet Explorer
I struggle with working with Internet Explorer. Issue one: I have used min-height:100% and

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.