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,170 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:vardium
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now