Spawn New Browser Using LinkButton Control

N

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.
 
J

Joshua Flanagan

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
 

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,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top