Target _Blank

3 posts, 0 answers
  1. Francesco Vivaldi
    Francesco Vivaldi avatar
    13 posts
    Member since:
    Nov 2009

    Posted 22 Jul 2011 Link to this post

    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. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 22 Jul 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Slav
    Admin
    Slav avatar
    1355 posts

    Posted 22 Jul 2011 Link to this post

    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!

Back to Top