Pop-up window showing but not loading after SP2

R

Richard

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
 
J

Juan Romero

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!
 
V

Vidar Petursson

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
==============================
 
R

Richard

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top