NavigateUrl with Target="_blank"

4 posts, 0 answers
  1. Sergey
    Sergey avatar
    2 posts
    Member since:
    Oct 2007

    Posted 12 Mar 2015 Link to this post

    I have 2 levels TabStrip.
    Last item on 1st level is Help

                    <telerik:RadTab Text="Help" NavigateUrl="http://www.google.com" Target="_blank">
                    </telerik:RadTab>

    I want to user stay on current tabs when he/she clicks "Help" tab. 
    Currently browser opens new window but selects Help empty page. 

    Could you guide me how to achieve that behavior.

    thanks.
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 16 Mar 2015 Link to this post

    Hello,

    The default RadTab on-click behavior, when its NavigateUrl and Target properties are set the way you are setting them, is the following:
    • the tab is selected
    • the tab is expanded if it contains child tabs
    • a new browser tab is opened loading the page you provide in the NavigateUrl property.
    If you do not set the Target property, a new browser tab will not be opened and the page will load in the current one.

    Could you please explain, step-by-step, what do you expect to happen when a user clicks on the tab?

    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sergey
    Sergey avatar
    2 posts
    Member since:
    Oct 2007

    Posted 16 Mar 2015 in reply to Ivan Danchev Link to this post

    I expect. 
    the tab is NOT selected (the currently selected tab remains selected)
    the tab is NOT expanded if it contains child tabs
    a new browser tab is opened loading the page you provide in the NavigateUrl property.
  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 19 Mar 2015 Link to this post

    Hello,

    Thank you for the explanation.

    You can achieve that if you subscribe to the RadTabStrip's OnClientTabSelecting event and use the following code in its event handler:
    Javascript:
    function OnClientTabSelecting(sender, eventArgs) {
     
        var tab = eventArgs.get_tab();
        var navigateUrl = tab.get_navigateUrl();
        if (navigateUrl && navigateUrl != "#")
        {
            window.open(navigateUrl);
            eventArgs.set_cancel(true);
        }
    }

    ASPX:
    <telerik:RadTabStrip runat="server" ID="RadTabStrip1" OnClientTabSelecting="OnClientTabSelecting">
    </telerik:RadTabStrip>

    Regards,
    Ivan Danchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top