469,608 Members | 2,163 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Spawn New Browser Using LinkButton Control

nwa
Using the LinkButton control on a web form, how can I make the clicking of
it open a new browser instance?

I know how to do it with the normal anchor tag, but not this ASP.NET
control.

I need the clicking of the LinkButton to call the click event handler to
execute some code, then redirect to another page, but the other page is in
the new browser window. And, we don't want to use JavaScript, such as:

Page.RegisterClientScriptBlock("newWin", "window.open(" + url + ",
'windowName', 'args-you fill in');");

(This causes popup blockers to block the new browser window.)

Thanks.
Nov 19 '05 #1
1 3571
I don't think it can be done with your restrictions.

A LinkButton is just another way to post back to the server. Think of
it as a Submit button that looks different. It is not the same as a
hyperlink.

If you ened to perform server-side code when users click the link, and
you want it to show results in a new window, you are going to have to
use Javascript and window.open. Make it clear to your users to disable
their pop-up blockers. If you want your site to cater to people that
use pop-up blockers, then you probably shouldn't be popping up any new
browser windows!

Joshua Flanagan
http://flimflan.com/blog

nwa wrote:
Using the LinkButton control on a web form, how can I make the clicking of
it open a new browser instance?

I know how to do it with the normal anchor tag, but not this ASP.NET
control.

I need the clicking of the LinkButton to call the click event handler to
execute some code, then redirect to another page, but the other page is in
the new browser window. And, we don't want to use JavaScript, such as:

Page.RegisterClientScriptBlock("newWin", "window.open(" + url + ",
'windowName', 'args-you fill in');");

(This causes popup blockers to block the new browser window.)

Thanks.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by tmb | last post: by
3 posts views Thread by Teckie03 | last post: by
1 post views Thread by ratnakarp | last post: by
1 post views Thread by sck10 | last post: by
reply views Thread by Eugene Anthony | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.