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,167 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

15 Experts available now in Live!

Get 1:1 Help Now