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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:47:52+00:00 2026-05-27T16:47:52+00:00

I have a aspx page containing an iframe which shows a pdf ( i

  • 0

I have a aspx page containing an iframe which shows a pdf ( i have ashx handler to display pdf in iframe), I also have a download button which onclick stream’s a different pdf to the browser as an attachment.
download to browser code: (this is in ashx handler)

    byte[] bytes =  // get byte array from table
    Response.Buffer = false;
    Response.Clear();
    Response.ClearContent();
    Response.ClearHeaders();
    Response.ContentType = "application/pdf";
    // [optional]
    Response.AddHeader(
           "Content-Disposition",
           string.Format("attachment; filename={0}", attachmentName)
     );
    Response.OutputStream.Write(bytes, 0, bytes.Length);
    Response.End();

This code works fine however after sending this response to the browser my iframe goes blank and I have to refresh the page in order to see it again. I tried most of the solutions

  1. http://adamyoung.net/IE-Blocking-iFrame-Cookies
  2. http://forums.asp.net/p/1036628/1433536.aspx

but none of them is working. iframe behaves fine in chrome & FF.
Note: if i do downloading stuff using asp:hyperlink to my ashx and setting target=”_blank” it works fine in IE but i need some server side processing to do therefore i cant use this method.

  • 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-27T16:47:53+00:00Added an answer on May 27, 2026 at 4:47 pm

    While Chrome and FF leave the page there, this does actually make sense.

    You are posting back to the server, then clearing your whole output, placing a file in the stream and sending that. Technically I would say IE is right in blanking out the page.

    This is assuming your download button is in the iframe?

    The solution I would try is putting that download link in another iFrame or have another page that downloads it and when you press a link it opens the new page which just outputs a file. So the window flashes up but then it disappears and a save dialog button appears. However popup blockers might try to stop this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one aspx page with some controls. Also i have one DIV which
I have an aspx page containing an iFrame in it. The iFrame loads a
I have an aspx page with 1 table containing 2 rows: <!DOCTYPE html PUBLIC
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
I have a formview on my aspx page containing various controls arranged using table.
i have an aspx page containing following code <body> <script language=javascript type=text/javascript> function Hidee()
I have an aspx page with a Masterpage containing a panel with a CssClass
I have aspx page on which i have something like that: <% string image;
I have page Add.aspx containing a number of UserControls : AddRequest.ascx, AddOperation.ascx, AddObject.ascx, etc.

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.