Popups not working, even if Popups are allowed in IE

Discussion in 'ASP .Net' started by Moe Sisko, Aug 4, 2008.

  1. Moe Sisko

    Moe Sisko Guest

    Using : ASP.NET 2.0, IE 7.

    This is a strange problem with popups not working in IE to remote sites,
    even though popups are allowed in IE.

    To reproduce, create web site with two pages, Default.aspx and
    Default2.aspx. Note that the example is a deliberately simplified example -
    just used to reproduce the problem, and not meant to be very useful.

    Default.aspx - add button1. In codebehind, hookup click event :
    ==
    protected void Button1_Click(object sender, EventArgs e)
    {
    string scriptText = "window.open('Default2.aspx','', '');";

    ClientScript.RegisterStartupScript(GetType(), "MyKey", scriptText,
    true);
    }
    ==

    In Default2.aspx codebehind, add :
    ==
    protected void Page_Load(object sender, EventArgs e)
    {
    Response.Clear();
    Response.ContentType = "text/plain";

    Response.AddHeader("Content-Disposition", "attachment; filename=" +
    "Report.txt");

    Response.Write("hello world");
    Response.Flush();
    Response.End();
    }
    ==

    Browse to Default.aspx, then click button1. The intended behaviour is for a
    dialog box to come up, with something like : "Do you want to open or save
    this file ?". Then the user can view or save this file. This all works fine
    when the browser and web site are all on the same PC. Popups are enabled in
    IE. (Note that I'm using IIS to the run the pages from outside the Visual
    Studio IDE).

    However, when browsing to a remote site hosting these pages over the
    internet, even though popups are allowed for this site in IE, the dialog box
    never comes up, and the user never gets a chance to see the file. If I hold
    down the CTRL key (to disable popups for the request), then press button 1,
    then things work. But I don't understand why the CTRL key needs to be
    pressed in IE when popups are disabled.

    Using Firefox 2, things work ok.

    Has anyone seen this ? Any ideas ?
    TIA,
    Moe
    Moe Sisko, Aug 4, 2008
    #1
    1. Advertising

  2. Moe Sisko

    George Guest

    You might have more than one PopUp killer in IE.

    IE has one, then any toolbar like Google toolbar, Yahoo toolbar.... might
    have another one...

    George.

    "Moe Sisko" <null> wrote in message
    news:...
    > Using : ASP.NET 2.0, IE 7.
    >
    > This is a strange problem with popups not working in IE to remote sites,
    > even though popups are allowed in IE.
    >
    > To reproduce, create web site with two pages, Default.aspx and
    > Default2.aspx. Note that the example is a deliberately simplified
    > example - just used to reproduce the problem, and not meant to be very
    > useful.
    >
    > Default.aspx - add button1. In codebehind, hookup click event :
    > ==
    > protected void Button1_Click(object sender, EventArgs e)
    > {
    > string scriptText = "window.open('Default2.aspx','', '');";
    >
    > ClientScript.RegisterStartupScript(GetType(), "MyKey", scriptText,
    > true);
    > }
    > ==
    >
    > In Default2.aspx codebehind, add :
    > ==
    > protected void Page_Load(object sender, EventArgs e)
    > {
    > Response.Clear();
    > Response.ContentType = "text/plain";
    >
    > Response.AddHeader("Content-Disposition", "attachment; filename=" +
    > "Report.txt");
    >
    > Response.Write("hello world");
    > Response.Flush();
    > Response.End();
    > }
    > ==
    >
    > Browse to Default.aspx, then click button1. The intended behaviour is for
    > a dialog box to come up, with something like : "Do you want to open or
    > save this file ?". Then the user can view or save this file. This all
    > works fine when the browser and web site are all on the same PC. Popups
    > are enabled in IE. (Note that I'm using IIS to the run the pages from
    > outside the Visual Studio IDE).
    >
    > However, when browsing to a remote site hosting these pages over the
    > internet, even though popups are allowed for this site in IE, the dialog
    > box never comes up, and the user never gets a chance to see the file. If
    > I hold down the CTRL key (to disable popups for the request), then press
    > button 1, then things work. But I don't understand why the CTRL key needs
    > to be pressed in IE when popups are disabled.
    >
    > Using Firefox 2, things work ok.
    >
    > Has anyone seen this ? Any ideas ?
    > TIA,
    > Moe
    >
    >
    >
    >
    >
    >
    >
    >
    George, Aug 4, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stan Goodman

    Even older fart, even newer newbie

    Stan Goodman, Jul 3, 2003, in forum: Java
    Replies:
    11
    Views:
    670
    Stan Goodman
    Jul 4, 2003
  2. Jake Barnes
    Replies:
    5
    Views:
    802
    xmlBlueprint Team
    Dec 21, 2005
  3. Andy Fish
    Replies:
    1
    Views:
    185
    Andy Fish
    Oct 27, 2004
  4. Iñaki Baz Castillo
    Replies:
    13
    Views:
    468
    Iñaki Baz Castillo
    May 1, 2011
  5. Charleees
    Replies:
    1
    Views:
    98
    David Squire
    Jun 10, 2006
Loading...

Share This Page