Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-09-29
4
1,175 Views
Last Modified: 2008-03-17
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
0
Comment
Question by:pgilfeather
4 Comments
 
LVL 6

Expert Comment

by:Volkan Vardar
ID: 12178177
Response.Write("<script>window.open('pageURL.aspx')</script>")
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12178861
Button1.Attributes.Add("Onclick", "Javascript:window.open('http://someserver/somecgi.exe?params=whatever','new','resizable=yes')")

Regards,

Aeros
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
ID: 12179047
For customized window using Javascript, try this link: http://javascript.about.com/library/weekly/aa031203a.htm
In ASP.Net you can use Javascript this way:
Inside the Button_Clicked event,

    Dim MyJavaScript As String
    MyJavaScript = "<script>window.open('pageURL.aspx')</script>"
    Page.RegisterStartupScript(MyScript, MyJavaScript)

More on RegisterSctript: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterStartupScriptTopic.asp

-Baan
0
 
LVL 33

Expert Comment

by:raterus
ID: 12180779
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.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question