RadButton Target property not working in OnClick event

4 posts, 0 answers
  1. SUBBU
    SUBBU avatar
    10 posts
    Member since:
    Apr 2012

    Posted 24 Apr 2013 Link to this post

    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.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Apr 2013 Link to this post

    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
  3. SUBBU
    SUBBU avatar
    10 posts
    Member since:
    Apr 2012

    Posted 25 Apr 2013 Link to this post

    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.  
  4. Prathyusha
    Prathyusha avatar
    10 posts
    Member since:
    Oct 2012

    Posted 26 Apr 2013 Link to this post

    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.


Back to Top