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

RadButton Target property not working in OnClick event

3 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SUBBU
Top achievements
Rank 1
SUBBU asked on 24 Apr 2013, 05:49 PM
Hi,
We have a RadButton with Target property set to "_blank".  In the OnClick method we have Response.Redirect("www.google.com").

But the requested url is not opening in new window. Any suggestion is appreciated. Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2013, 04:28 AM
Hi,

The Target property only works when the ButtonType is set to LinkButton. It doesn't work with the default Button setting.
aspx:
<telerik:RadButton ID="RadButton1" runat="server"  Target="_blank"
    Text="redirect"  ButtonType="LinkButton">
</telerik:RadButton>

Thanks,
Shinu
0
SUBBU
Top achievements
Rank 1
answered on 25 Apr 2013, 07:06 AM
Hi Shinu,
Thanks for your response. We have the ButtonType as LinkButton.  But Target property is still not working inside OnClick event, when i use Response.Redirect.  
0
Prathyusha
Top achievements
Rank 1
answered on 26 Apr 2013, 05:26 AM
Hi Subbu

Instead of response.redirct use in Onclick event of button.

Response.Write(

"<script>");

Response.Write(

 

"window.open('http://www.google.co.in/','_blank')");

Response.Write(

 

"</script>");

Other wise use Hyperlinkbutton.


Tags
General Discussions
Asked by
SUBBU
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
SUBBU
Top achievements
Rank 1
Prathyusha
Top achievements
Rank 1
Share this question
or