Link to home
Start Free TrialLog in
Avatar of pgilfeather
pgilfeather

asked on

I am using a LinkButton and want to navigate to another page that opens with blank target (target="_blank")

I am using a LinkButton and want to navigate to another page that opens with blank target (target="_blank")

I have used response.redirect(URL) to navigate to the page but the LinkButton wont accept target="_blank" property.

I am using a linkbutton because I need other code to respond to the click event.

If there is an easier way to navigate to a page, respond to the click event and have the page you navigate to open up in a target="_blank" setup then I'll be delighted to hear about it.

Thanks in advance

Paul G
Avatar of Volkan Vardar
Volkan Vardar

Response.Write("<script>window.open('pageURL.aspx')</script>")
Button1.Attributes.Add("Onclick", "Javascript:window.open('http://someserver/somecgi.exe?params=whatever','new','resizable=yes')")

Regards,

Aeros
ASKER CERTIFIED SOLUTION
Avatar of DotNetLover_Baan
DotNetLover_Baan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Essentially what everyone is trying to say is LinkButtons ALWAYS postback to the server, that is what they are meant to do.  If you don't need to postback before you redirect, then I would just use a regular hyperlink.