473,396 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Popup window blocking in XP Service Pack 2

Hi

I have a web app that has a legitimate use for pop up windows. My web app is
an insurance quoting app. I use the window.open method to display another
aspx page so that the user can check some information without losing where
they are up to in the application process.

I also use it later to display a pdf application form. I want this to be in
a separate window because a separate pdf application form is required for
each person and the application might be for more than one person. If I
display it in the main window then I would have to hope that the user would
know to click on back to go back and be able to display the pdf's for
another person.

I know I can have a hyperlink to the pdf and open it in a separate window
but it depends on user input so I use an "Apply" ImageButton, save the
details to the database and then generate the pdf. This wouldn't work with a
hyperlink.

This is an example of the code I am using in the click event of an
ImageButton

private void ibOpenWindow_Click(object sender,
System.Web.UI.ImageClickEventArgs e)

{

string javaScript = "<script>window.open('Info.aspx', 'Info', 'height=400,
width=400, resizable=no');</script>";

Page.RegisterStartupScript( "script", sJavaScript );

}

On MSDN I found this article:

http://msdn.microsoft.com/security/p...l/xpsp2web.asp

It contains the following text:

<quote>

What does Internet Explorer consider a pop-up window?
Internet Explorer will attempt to block any window opened automatically from
script, with the exception of createPopup(). Some common functions that are
affected are window.open(), showModelessDialog(), showModalDialog(), and
showHelp(). (Note: Targeting the search pane automatically is also blocked
due to pop-up blocking restrictions.)

A pop-up window opened as a direct result of a user action (e.g., clicking a
page element) will not be blocked. Pop-up blocking does not apply by default

to the Intranet or Trusted Sites Zones.

</quote>

Does this mean that I can not use window.open at all? Even if I turn popup
blocking off in SP2 the code above still does not work.

Does anyone know a way around this problem? I can't use window.createPopup
because I can't display an aspx page or pdf using this method.

Thanks for you suggestions

Simon

Nov 18 '05 #1
5 2084
"Simon Knox" <si********@seconag.com> wrote in
news:u3*************@tk2msftngp13.phx.gbl:
Does this mean that I can not use window.open at all? Even if I turn
popup blocking off in SP2 the code above still does not work.


Add the site to your trusted list of pop-up sites. Window.open should work
fine (works fine on my end).

Do you have another pop-up blocker running?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2
Hi Lucas

Thanks for your reply.

I was hoping to find a way to avoid having to tell customers to add the site
to there list of trusted sites as I think many customers might be concerned
about why they have to do this.

Simon
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Simon Knox" <si********@seconag.com> wrote in
news:u3*************@tk2msftngp13.phx.gbl:
Does this mean that I can not use window.open at all? Even if I turn
popup blocking off in SP2 the code above still does not work.


Add the site to your trusted list of pop-up sites. Window.open should work
fine (works fine on my end).

Do you have another pop-up blocker running?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 18 '05 #3
"Simon Knox" <si********@seconag.com> wrote in
news:eO**************@TK2MSFTNGP11.phx.gbl:
I was hoping to find a way to avoid having to tell customers to add
the site to there list of trusted sites as I think many customers
might be concerned about why they have to do this.


This is by design - as you know, pop-ups are abused by many sites... so
Microsoft treats all with suspicion. This is how all pop-up blockers work.

I guess you'll have to put a big message telling users to allow pop-ups, or
verify the pop-up has actually occured or else display an error message.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #4
Did you ever find a work around this problem? I have the same issue. I need
an excel file to be opened up using window.open() but IE security setting
"automatic prompting for file download" has to be enabled in the users
machings for it to work. By default it is disabled, so I am also looking for
a way to do the same thing without asking the users to change any of their
settings. Did you find something like this?

"Simon Knox" wrote:
Hi Lucas

Thanks for your reply.

I was hoping to find a way to avoid having to tell customers to add the site
to there list of trusted sites as I think many customers might be concerned
about why they have to do this.

Simon
"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"Simon Knox" <si********@seconag.com> wrote in
news:u3*************@tk2msftngp13.phx.gbl:
Does this mean that I can not use window.open at all? Even if I turn
popup blocking off in SP2 the code above still does not work.


Add the site to your trusted list of pop-up sites. Window.open should work
fine (works fine on my end).

Do you have another pop-up blocker running?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/


Nov 18 '05 #5
Hello Simon,

Modify your code to run in the mouseup handler, rather than on page startup...

http://www.mattberther.com/2004/08/000530.html

--
Matt Berther
http://www.mattberther.com
Hi

I have a web app that has a legitimate use for pop up windows. My web
app is an insurance quoting app. I use the window.open method to
display another aspx page so that the user can check some information
without losing where they are up to in the application process.

I also use it later to display a pdf application form. I want this to
be in a separate window because a separate pdf application form is
required for each person and the application might be for more than
one person. If I display it in the main window then I would have to
hope that the user would know to click on back to go back and be able
to display the pdf's for another person.

I know I can have a hyperlink to the pdf and open it in a separate
window but it depends on user input so I use an "Apply" ImageButton,
save the details to the database and then generate the pdf. This
wouldn't work with a hyperlink.

This is an example of the code I am using in the click event of an
ImageButton

private void ibOpenWindow_Click(object sender,
System.Web.UI.ImageClickEventArgs e)
{

string javaScript = "<script>window.open('Info.aspx', 'Info',
'height=400, width=400, resizable=no');</script>";

Page.RegisterStartupScript( "script", sJavaScript );

}

On MSDN I found this article:

http://msdn.microsoft.com/security/p...ault.aspx?pull
=/library/en-us/dnwxp/html/xpsp2web.asp

It contains the following text:

<quote>

What does Internet Explorer consider a pop-up window?
Internet Explorer will attempt to block any window opened
automatically from
script, with the exception of createPopup(). Some common functions
that are
affected are window.open(), showModelessDialog(), showModalDialog(),
and
showHelp(). (Note: Targeting the search pane automatically is also
blocked
due to pop-up blocking restrictions.)
A pop-up window opened as a direct result of a user action (e.g.,
clicking a page element) will not be blocked. Pop-up blocking does not
apply by default

to the Intranet or Trusted Sites Zones.

</quote>

Does this mean that I can not use window.open at all? Even if I turn
popup blocking off in SP2 the code above still does not work.

Does anyone know a way around this problem? I can't use
window.createPopup because I can't display an aspx page or pdf using
this method.

Thanks for you suggestions

Simon


Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: dave yan | last post by:
hi, i have some forms which use javascript for data validation, e.g., checking to make sure all required fields are completed, checking that data falls within valid ranges for certain fields,...
38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
3
by: Dan | last post by:
First, I'm sorry if this question has been asked too many times. I'm new to this news group. The question has to do with the use of popup windows in a web page. I have heard that popup windows...
3
by: Jeppe bob Dyrby | last post by:
I have a page that automaticly opens a small popup window, but it is only supposed to open this window once. A little info: function openwindow(name_var) { if (!name_var) { name_var =...
8
by: Bijoy Naick | last post by:
It seems like the BBC sports site is able to get past popup blockers.. For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on the Video icon under "Watch and Listen" - right hand...
26
by: Raffi | last post by:
Hi, We have a database application that runs in a popup Internet Explorer application window. The reason for this is to isolate the casual user from the address bar and the typical IE navigation...
15
by: | last post by:
So many websites can get around my Googlebar's popup blockers. Even Opera 8 can not stop those popups. I looked into the codes, and I can find nothing showing me how it is done. Can anyone help me...
9
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in...
9
by: Rathtap | last post by:
I want to popup a window from my codebehind. The reason is that during the postback the code needs to do some validations and to build the arguments that are passed in the url. How can I achieve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.