Bypass Pop-up Blocker

U

usamaalam

Hello Everybody,

On the click of my server side button control, I am performing some server
side processing and then open a new browser window.

Code:
// Server Side Code, Database calls etc.

string js = "";
js += "<script>";
js += "	window.open('" + url + "');";
js += "	window.close();";
js += "</script>";

Page.RegisterStartupScript("",js);

The problem is the window is blocked by the Pop-up blocker. If I need not do 
any server side processing, then I can use onClick event on a button to 
directly open the window or use hyperlink, but in this case when I need to do 
some processing and then open the window without letting the pop-up blocker 
stop it.

Is there any way to do it?

Thanks.
 
H

Hans Kesting

usamaalam explained on 2-1-2008 :
Hello Everybody,

On the click of my server side button control, I am performing some server
side processing and then open a new browser window.

Code:
// Server Side Code, Database calls etc.

string js = "";
js += "<script>";
js += "	window.open('" + url + "');";
js += "	window.close();";
js += "</script>";

Page.RegisterStartupScript("",js);

The problem is the window is blocked by the Pop-up blocker. If I need not do 
any server side processing, then I can use onClick event on a button to 
directly open the window or use hyperlink, but in this case when I need to do 
some processing and then open the window without letting the pop-up blocker 
stop it.

Is there any way to do it?

Thanks.[/QUOTE]

Maybe you can do it the other way around:
1) open a new window as a reaction to that click
2) have the url you 'show' in that popup perform the processing
3) redirect to a page that shows the results

If 'this particular' processing-run should not result in a popup, you 
could close it by javascript.

Hans Kesting
 
U

usamaalam

Point 1 and 2 is fine, but as in point 3 if I redirect to the url from the
parent window it will show the url in the same window instead of opening it
in a new pop-up window.

What I am doing is on the click of the button, the server side event handler
is fired and it gets some data from the database and creates the url. This
url needs to be opened in a new browser window.

Thanks.

Hans Kesting said:
usamaalam explained on 2-1-2008 :
Hello Everybody,

On the click of my server side button control, I am performing some server
side processing and then open a new browser window.

Code:
// Server Side Code, Database calls etc.

string js = "";
js += "<script>";
js += "	window.open('" + url + "');";
js += "	window.close();";
js += "</script>";

Page.RegisterStartupScript("",js);

The problem is the window is blocked by the Pop-up blocker. If I need not do 
any server side processing, then I can use onClick event on a button to 
directly open the window or use hyperlink, but in this case when I need to do 
some processing and then open the window without letting the pop-up blocker 
stop it.

Is there any way to do it?

Thanks.[/QUOTE]

Maybe you can do it the other way around:
1) open a new window as a reaction to that click
2) have the url you 'show' in that popup perform the processing
3) redirect to a page that shows the results

If 'this particular' processing-run should not result in a popup, you 
could close it by javascript.

Hans Kesting
[/QUOTE]
 
H

Hans Kesting

usamaalam formulated the question :
Point 1 and 2 is fine, but as in point 3 if I redirect to the url from the
parent window it will show the url in the same window instead of opening it
in a new pop-up window.

What I am doing is on the click of the button, the server side event handler
is fired and it gets some data from the database and creates the url. This
url needs to be opened in a new browser window.

Thanks.

I probably didn't write it clearly enough, so let's try again:

1) don't process a server-click, but react client-side by opening the
popup with an intermediate page as url (you might need to add some
arguments to the url)
2) in that intermediate page, perform the processing that arrives at
the url that you really want to show (the intermediate page itself
doesn't show anything). Use the Page_Load for this.
3) at the end of the processing (in the intermediate page), redirect to
the url you found.
4) as this intermediate page is "shown" inside the popup-window, it's
this popup-window that is redirected to the new url.

Hans Kesting
usamaalam explained on 2-1-2008 :
Hello Everybody,

On the click of my server side button control, I am performing some server
side processing and then open a new browser window.

Code:
// Server Side Code, Database calls etc.

string js = "";
js += "<script>";
js += "	window.open('" + url + "');";
js += "	window.close();";
js += "</script>";

Page.RegisterStartupScript("",js);

The problem is the window is blocked by the Pop-up blocker. If I need not 
do  any server side processing, then I can use onClick event on a button to 
directly open the window or use hyperlink, but in this case when I need to 
do  some processing and then open the window without letting the pop-up 
blocker  stop it.

Is there any way to do it?

Thanks.[/QUOTE]

Maybe you can do it the other way around:
1) open a new window as a reaction to that click
2) have the url you 'show' in that popup perform the processing
3) redirect to a page that shows the results

If 'this particular' processing-run should not result in a popup, you 
could close it by javascript.

Hans Kesting
[/QUOTE][/QUOTE]
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top