New brower in ASP.Net but not a Pop up

S

sweetpotatop

Hello,

I wonder how I can open up a new browser from asp.net, I don't want a
pop up as users' machine might stop them from having pop. I use the
jscript window.ope, but that is a pop up. Can you please let me know
the alternative for having a new window up, but not pop-up please?

Thanks in advance.
Wanda
 
K

Kim Quigley

If you want to open the new window from a link, you can set the target
attribute to _blank
 
B

Bruce Barker

popups (window.open) are allowed when tied to a click onclick event, or in a
hyperlink.

<a href:="newpage.aspx" target="_blank">click here to open a new
window</a>

or

<button onclick="window.open('newpage.aspx');" value="click here to open
new window">

-- bruce (sqlwork.com)
 
S

sweetpotatop

I can use href, as that has to be a button. Secondly, I am using
asp:button. I have just tried making it
<asp:button onclick="..."> but it doesn't work. Besides, before the
page is redirected, I need to do quite a few checking from the code, if
it didn't pass, there will be no redirection.

In that case, how can I get this done?
Thanks in advance. Any help would be greatly appreciated.
 
K

Kim Quigley

You can use this in the code behind:
Response.Write("<script>window.open(""PageName.aspx"",""FrameName"");</script>")
 

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,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top