This is a migrated thread and some comments may be shown as answers.

Target _Blank

2 Answers 330 Views
Button
This is a migrated thread and some comments may be shown as answers.
Francesco Vivaldi
Top achievements
Rank 1
Francesco Vivaldi asked on 22 Jul 2011, 10:46 AM
HI,

I have one radButton, when i click it i must open a link in a new blank page.
i see the property "target" on radButton but it does not work

2 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 22 Jul 2011, 01:38 PM
Hello Francesco,

The Target property only works when you're ButtonType is set to LinkButton. It doesn't work with the default Button setting. The reason is the way it renders the control.

I hope that helps.
0
Slav
Telerik team
answered on 22 Jul 2011, 04:01 PM
Hello Kevin,

Indeed, the Target property takes effect if the ButtonType is set to LinkButton, this is the default RadButton behavior. You may utilize this type and set the button as image button. This is shown in the example below:
<telerik:RadButton ID="RadButton1" runat="server" ButtonType="LinkButton" Text="RadButton" NavigateUrl="http://www.telerik.com" Target="_blank" Width="37px" Height="36px">
    <Image ImageUrl="~/Images/cb_download.png" />
</telerik:RadButton>

If you insist on keeping the ButtonType to StandardButton you can achieve opening the requested page in new window by canceling the postback and opening the URL with Javascript on the client-side event OnClientClicking of RadButton. This implementation is discussed in the following forum thread: http://www.telerik.com/community/forums/aspnet-ajax/button/navigateurl.aspx

Kind regards,
Slav
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Button
Asked by
Francesco Vivaldi
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Slav
Telerik team
Share this question
or