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

A

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?
 
M

Mark Rae

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>");
 
A

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?
 
M

Mark Rae

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
 
Y

Yunus Emre ALPÖZEN [MCSD.NET]

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 ALPÖZEN
BSc, MCSD.NET
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top