3 Answers, 1 is accepted
0
Hello,
The Target property of the RadButton has a meaning in the context of ButtonType="LinkButton", along with the NavigateUrl property. For example:
When you click on the RadButton the google URL will be opened in a new tab. The Response.Redirect() method, however, is not an embedded method of the RadButton but part of ASP.NET and that is why it redirects the target url to the current tab.
More information on using link buttons is avilable here and here.
Kind regards,
Danail Vasilev
the Telerik team
The Target property of the RadButton has a meaning in the context of ButtonType="LinkButton", along with the NavigateUrl property. For example:
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Click"
NavigateUrl
=
"http://www.google.com"
ButtonType
=
"LinkButton"
Target
=
"_blank"
/>
More information on using link buttons is avilable here and here.
Kind regards,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0

SUBBU
Top achievements
Rank 1
answered on 26 Apr 2013, 02:29 AM
Hi Danail,
Thanks for your response. Is there any other way that I can open a link in a new/active window(this will be decided in the Page_Load) along with OnClick event using any of the telerik components? We cant use asp components because, in case of hyperlink we dont have OnClick property and in case of Link Button we dont have target property.
Thanks for your response. Is there any other way that I can open a link in a new/active window(this will be decided in the Page_Load) along with OnClick event using any of the telerik components? We cant use asp components because, in case of hyperlink we dont have OnClick property and in case of Link Button we dont have target property.
0
Hello,
I am not sure about your actual scenario, so I can suggest you try one of the following approaches:
C#:
where the highlighted properties override the ones set declaratively.
C#:
More information on executing JavaScript function on the server-side is available in this help article.
Kind regards,
Danail Vasilev
the Telerik team
I am not sure about your actual scenario, so I can suggest you try one of the following approaches:
- Either override the properties of the RadButton that are set in the markup with the desired ones on the server, for example on Page_Load:
<
telerik:RadButton
runat
=
"server"
ID
=
"RadButton1"
ButtonType
=
"LinkButton"
Text
=
"Click"
NavigateUrl
=
"http://www.bing.com"
Target
=
"_top"
>
</
telerik:RadButton
>
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadButton1.NavigateUrl =
"http://www.telerik.com"
;
RadButton1.Target =
"_blank"
;
}
- OR register a startup script that opens a new window with the desired URL, when the server-side OnClick event is triggered. For example:
<
telerik:RadButton
runat
=
"server"
ID
=
"RadButton1"
Text
=
"Click"
OnClick
=
"OnClick1"
>
</
telerik:RadButton
>
protected
void
OnClick1(
object
sender, EventArgs e)
{
string
openURL =
"<script language='javascript'>function f() { window.open('http://www.telerik.com/','_blank'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>"
;
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"openURL"
, openURL);
}
Kind regards,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.