Is there a way to set target?

6 posts, 0 answers
  1. Phil
    Phil avatar
    15 posts
    Member since:
    Mar 2012

    Posted 04 Sep 2015 Link to this post

    On the menu control you can ".Target" on a RadMenuItem.

     

    How do I do that for a navigation control?

    I have a few items that I want to open into a new tab rather than redirecting.

     

    Thanks

  2. Phil
    Phil avatar
    15 posts
    Member since:
    Mar 2012

    Posted 04 Sep 2015 in reply to Phil Link to this post

    Also is there a way to just bind a target property to the object that im binding it to like we do for DataTextField and DataNavigateUrlField?

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    835 posts

    Posted 08 Sep 2015 Link to this post

    Hello,

    The RadNavigation does not have a DataTargetField property. Setting the Node's target can be done on the client, for example in the OnClientNodeClicking handler. To do so you can subscribe to the event and call the node's set_target() method in event's handler as shown below:
    function OnClientNodeClicking(sender, eventArgs) {
        var node = eventArgs.get_node();
        node.set_target("_blank");
    }

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Phil
    Phil avatar
    15 posts
    Member since:
    Mar 2012

    Posted 08 Sep 2015 in reply to Ivan Danchev Link to this post

    Is there a way to do this server site?

     

     

  6. Phil
    Phil avatar
    15 posts
    Member since:
    Mar 2012

    Posted 08 Sep 2015 in reply to Phil Link to this post

    Err i mean "server side"
  7. Ivan Danchev
    Admin
    Ivan Danchev avatar
    835 posts

    Posted 09 Sep 2015 Link to this post

    Hello,

    Yes, you can set a node's Target property server-side by accessing it in the RadNavigation's Nodes collection by index or finding it by Text/Url:
    RadNavigation1.Nodes[0].Target = "_blank";
    RadNavigation1.FindNodeByText("Root1").Target = "_blank";
    RadNavigation1.FindNodeByUrl("http://www.telerik.com").Target = "_blank";

    Regards,
    Ivan Danchev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017