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

NavigateUrl with Target="_blank"

3 Answers 218 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Sergiy
Top achievements
Rank 1
Sergiy asked on 12 Mar 2015, 01:55 PM
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.

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 16 Mar 2015, 04:04 PM
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.

 
0
Sergiy
Top achievements
Rank 1
answered on 16 Mar 2015, 04:12 PM
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.
0
Ivan Danchev
Telerik team
answered on 19 Mar 2015, 01:48 PM
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.

 
Tags
TabStrip
Asked by
Sergiy
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Sergiy
Top achievements
Rank 1
Share this question
or