470,625 Members | 2,021 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,625 developers. It's quick & easy.

How to open another .aspx as target="_blank"

ad
I used Response.Redirect(sUrl); to open another .aspx
But I want to open it in another browser like target="_blank"
How can I do that?

Nov 19 '05 #1
4 1926
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I used Response.Redirect(sUrl); to open another .aspx
But I want to open it in another browser like target="_blank"
How can I do that?


I'm not sure you can directly, because opening another window (i.e. another
instance of your browser) is a client-side function, not a server-side
function. However, I'm pretty sure you could do it with something like:

RegisterStartupScript("TargetBlank", "<script>window.open('" + sUrl +
"');</script>");
Nov 19 '05 #2
ad
Thanks,

I have antother question,
I open b.aspx in a.aspx, when the user close b.aspx by click the close
button,
how can we refresh the a.aspx?

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> glsD
:#T**************@TK2MSFTNGP12.phx.gbl...
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I used Response.Redirect(sUrl); to open another .aspx
But I want to open it in another browser like target="_blank"
How can I do that?
I'm not sure you can directly, because opening another window (i.e.

another instance of your browser) is a client-side function, not a server-side
function. However, I'm pretty sure you could do it with something like:

RegisterStartupScript("TargetBlank", "<script>window.open('" + sUrl +
"');</script>");

Nov 19 '05 #3
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
I have antother question,
I open b.aspx in a.aspx, when the user close b.aspx by click the close
button,
how can we refresh the a.aspx?


Again, this has to be done client-side.

Simply create a while loop to wait until the window variable you populated
with window.open is null.

There are loads of examples of similar functionality here:

http://www.irt.org/script/window.htm
Nov 19 '05 #4
But using a while causes unnecessary cpu usage.
My advice u to add button to your opener page and modify style attribute as
"display:none". this will hide your button to user. And then from your popup
window before close code u should raise a click event for your hidden
button..

window.opener.document.all.my_hidden_button.click( )
window.close()

or something like...

--
HTH

Thanks,
Yunus Emre ALPZEN
BSc, MCSD.NET

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
I have antother question,
I open b.aspx in a.aspx, when the user close b.aspx by click the close
button,
how can we refresh the a.aspx?


Again, this has to be done client-side.

Simply create a while loop to wait until the window variable you populated
with window.open is null.

There are loads of examples of similar functionality here:

http://www.irt.org/script/window.htm

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Sugapablo | last post: by
12 posts views Thread by Romain | last post: by
16 posts views Thread by St. Rechsteiner | last post: by
5 posts views Thread by John A Grandy | last post: by
28 posts views Thread by Jim Carlock | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.