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

  • Home
  • SEARCH
  • 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 6718083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:55:40+00:00 2026-05-26T08:55:40+00:00

I am in a modal window. I have an hyperlink which points on an

  • 0

I am in a modal window.

I have an hyperlink which points on an ashx file.

this ashx file use Response.BinaryWrite to push the file for download and I then want to close the modal.

the things is that

if I use

Response.BinaryWrite(myFile);
Response.("<script type='text/javascript'>window.close();</script>");

it does not work.

if I let alone

Response.("<script type='text/javascript'>window.close();</script>");

it works.

Any body having a solution for this ?

thx

  • 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-26T08:55:41+00:00Added an answer on May 26, 2026 at 8:55 am

    No, there’s no solution because your lines above do two different things:

    The first line is basically streaming a file to the user. Until the user responds to the dialog that appears (he either chooses to save or display it on the screen) there’s nothing you can do. It seems you are attempting to close the user’s dialog automatically but you can’t control the user’s browser from server side code.

    The second line works because all you are doing is sending javascript code that instructs the browser window to close itself. You can’t intertwined these 2 things in the same response stream.

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

Sidebar

Related Questions

I have a modal window which opens up a login form, then i click
I have a modal window which helps formatting text. I have multiple textareas on
I have a modal window which closes when i add an item. The parent
i have a serious problem here. i'm trying to use a modal window in
I have a gridview in jquery modal window. this grid displays different results depending
I have using colobox which is a jquery modal window to create a login/regiestration
I have the following link which opens a jquery modal window: <div id='confirm-dialog'><a href='#'
I have a modal window from which I am calling a lighbox to view
Using nyroModal I have setup a modal window with some text boxes. This window
I have a form which I load within a modal window in that from

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.