Pop-up window showing but not loading after SP2

Discussion in 'ASP .Net' started by Richard, Aug 25, 2004.

  1. Richard

    Richard Guest

    I have an ASP.NET webapp that generates a shipping label for a
    customer. When the user clicks on the label preview gif or on a
    "Print..." submit button, the app will open another window with a full
    sized label.

    Before I installed SP2 my workstation, all worked fine. However, now
    with SP2 it opens the label window, but the page doesn't load in the
    browser. When debugging in VS.NET, the Page_Init of the pop-up page
    does not even run. This is only an issue with IE and no other
    browsers. I've done about every Security setting in the Internet
    Options as well (and turned off popup blocking).


    Here is a rundown of what the code is like:

    1. The LabelPreview.aspx page has a Print button that generates a
    script to open a pop-up window:

    Dim popUpWindow As String =
    "<scriptlanguage='javascript'>window.open('PrintView.aspx')</script>"
    RegisterStartupScript("popUpWindow", popupWindow)


    2. PrintView.aspx uses another aspx page as an image (example; <img
    src="Label.aspx">) and has behind-code that writes to an internal
    database...note: the Page_Init in the behind-code is not firing.


    3. Label.aspx is used to stream the image. Tt has mLabel as a member
    object which is coming from a session variable that was generated even
    before the user reaches these pages:

    Dim stream As MemoryStream = New MemoryStream
    Dim buffer As Byte()

    mLabel = Session("objLabel")

    mLabel.Image.Save(stream, Imaging.ImageFormat.Png)
    buffer = stream.ToArray
    Response.ContentType = "multipart/mixed"
    Response.OutputStream.Write(buffer, 0, buffer.Length)
    Response.OutputStream.Flush()
    Response.OutputStream.Close()
    stream.Close()


    I am at a complete loss as to why this is not working. Anyone else
    experience this...any ideas are extremely appreciated.

    - Richard
     
    Richard, Aug 25, 2004
    #1
    1. Advertising

  2. Richard

    Juan Romero Guest

    Please see release notes for SP2. Popup Windows are now blocked by default.
    The code must be fired by user interaction. When you use a click event and
    generate the JS code, you are actually doing a postback to the server and
    coming back with a new page that is attempting to load a popup window
    "automatically". That is why it gets blocked. Change your code to have an
    HTML button that fires the popup window.

    Good Luck!

    "Richard" <> wrote in message
    news:cgiqp0$...
    > I have an ASP.NET webapp that generates a shipping label for a
    > customer. When the user clicks on the label preview gif or on a
    > "Print..." submit button, the app will open another window with a full
    > sized label.
    >
    > Before I installed SP2 my workstation, all worked fine. However, now
    > with SP2 it opens the label window, but the page doesn't load in the
    > browser. When debugging in VS.NET, the Page_Init of the pop-up page
    > does not even run. This is only an issue with IE and no other
    > browsers. I've done about every Security setting in the Internet
    > Options as well (and turned off popup blocking).
    >
    >
    > Here is a rundown of what the code is like:
    >
    > 1. The LabelPreview.aspx page has a Print button that generates a
    > script to open a pop-up window:
    >
    > Dim popUpWindow As String =
    > "<scriptlanguage='javascript'>window.open('PrintView.aspx')</script>"
    > RegisterStartupScript("popUpWindow", popupWindow)
    >
    >
    > 2. PrintView.aspx uses another aspx page as an image (example; <img
    > src="Label.aspx">) and has behind-code that writes to an internal
    > database...note: the Page_Init in the behind-code is not firing.
    >
    >
    > 3. Label.aspx is used to stream the image. Tt has mLabel as a member
    > object which is coming from a session variable that was generated even
    > before the user reaches these pages:
    >
    > Dim stream As MemoryStream = New MemoryStream
    > Dim buffer As Byte()
    >
    > mLabel = Session("objLabel")
    >
    > mLabel.Image.Save(stream, Imaging.ImageFormat.Png)
    > buffer = stream.ToArray
    > Response.ContentType = "multipart/mixed"
    > Response.OutputStream.Write(buffer, 0, buffer.Length)
    > Response.OutputStream.Flush()
    > Response.OutputStream.Close()
    > stream.Close()
    >
    >
    > I am at a complete loss as to why this is not working. Anyone else
    > experience this...any ideas are extremely appreciated.
    >
    > - Richard
    >
     
    Juan Romero, Aug 25, 2004
    #2
    1. Advertising

  3. Hi,

    Ok I assume this is a typo
    <scriptlanguage='javascript'>

    How is that script linked to the Print button......?

    Zonealarm on the system... ( Kills the most basic of scripts even it's told
    to leave alone )

    I have not had a single problem with any app I have made on SP2...
    Send me complete code and I will look it over if you want

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Visual: Scripting MVP 2000-2004
    http://www.icysoft.com/
    http://www.deus-x.com/ Instant e-commerce
    http://www.microsoft.com/technet/scriptcenter/
    Playground: http://213.190.104.211/ ( IE 5.5+ only )

    No matter where you go there you are
    ==============================
    "Richard" <> wrote in message
    news:cgiqp0$...
    >I have an ASP.NET webapp that generates a shipping label for a
    > customer. When the user clicks on the label preview gif or on a
    > "Print..." submit button, the app will open another window with a full
    > sized label.
    >
    > Before I installed SP2 my workstation, all worked fine. However, now
    > with SP2 it opens the label window, but the page doesn't load in the
    > browser. When debugging in VS.NET, the Page_Init of the pop-up page
    > does not even run. This is only an issue with IE and no other
    > browsers. I've done about every Security setting in the Internet
    > Options as well (and turned off popup blocking).
    >
    >
    > Here is a rundown of what the code is like:
    >
    > 1. The LabelPreview.aspx page has a Print button that generates a
    > script to open a pop-up window:
    >
    > Dim popUpWindow As String =
    > "<scriptlanguage='javascript'>window.open('PrintView.aspx')</script>"
    > RegisterStartupScript("popUpWindow", popupWindow)
    >
    >
    > 2. PrintView.aspx uses another aspx page as an image (example; <img
    > src="Label.aspx">) and has behind-code that writes to an internal
    > database...note: the Page_Init in the behind-code is not firing.
    >
    >
    > 3. Label.aspx is used to stream the image. Tt has mLabel as a member
    > object which is coming from a session variable that was generated even
    > before the user reaches these pages:
    >
    > Dim stream As MemoryStream = New MemoryStream
    > Dim buffer As Byte()
    >
    > mLabel = Session("objLabel")
    >
    > mLabel.Image.Save(stream, Imaging.ImageFormat.Png)
    > buffer = stream.ToArray
    > Response.ContentType = "multipart/mixed"
    > Response.OutputStream.Write(buffer, 0, buffer.Length)
    > Response.OutputStream.Flush()
    > Response.OutputStream.Close()
    > stream.Close()
    >
    >
    > I am at a complete loss as to why this is not working. Anyone else
    > experience this...any ideas are extremely appreciated.
    >
    > - Richard
    >
     
    Vidar Petursson, Oct 23, 2004
    #3
  4. Richard

    Richard Guest

    Sorry I haven't responded to this recently, but I haven't needed to
    investigate this problem again until recently.

    Petursson, yes, that was a typo...and the script is linked to a
    asp:button and thus runs a registered script (code behind includes the
    Page.RegisterStartupScript function).

    I'm not comfortable without having an explanation, but all runs fine
    now and I don't have a clue what is different. I'm not sure if SP2 had
    some additional updates that fixed this issue, or if it is from the
    GDI+ updates included with the newer security patches.

    All I can say is that I tested this in late August 2004 with a
    workstation and a laptop when SP2 was new, both with XP Professional,
    both with the same results. Come late 2004, and the problem as been
    fixed without me changing code.
     
    Richard, Jan 18, 2005
    #4
    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. George
    Replies:
    5
    Views:
    808
    =?Utf-8?B?S2VuIEJlYXJk?=
    Aug 24, 2004
  2. Richard
    Replies:
    1
    Views:
    410
    Harry Simpson
    Aug 25, 2004
  3. =?Utf-8?B?Q29uYW4=?=
    Replies:
    10
    Views:
    1,326
    =?Utf-8?B?WWFubmljayBUSEVWRU5FVA==?=
    Aug 31, 2005
  4. Bone Ur
    Replies:
    4
    Views:
    415
    Bone Ur
    Dec 19, 2007
  5. Likhith Areekkal

    Calendars overlap : IE SP2 ; WinXP SP2

    Likhith Areekkal, Dec 23, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    153
    Likhith Areekkal
    Dec 23, 2004
Loading...

Share This Page