Open in new window

6 posts, 0 answers
  1. Chris
    Chris avatar
    120 posts
    Member since:
    Jun 2006

    Posted 25 Sep 2008 Link to this post

    I have a rad menu being popluated by a SiteMapDataSource.  The SiteMapDataSource contains the code that should tell a specific link in the menu to open in a new window.  For some reason, the links are not opening in a new window.  I do not want every link to open in a new window, just the ones that I have designated in my SiteMapDataSource.

    By the way, the sitemapdatasource is being created by Sharepoint as I add sites and links.  When I go into sharepoint and select add link, it gives me an option for that link to open in a new window.  This functionallity seems to work in other WebParts and controls.
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 26 Sep 2008 Link to this post

    Hello Chris,

    I verified this behavior. Indeed the builtin menu correctly binds and sets the Target property of its item to "_blank" (so it opens in a new window). Unfortunately RadMenu cannot find the Target property because it does not "know" of SharePoint's PortalSiteMapNode object. The only workaround which I can propose is to use codebehind and subscribe to the ItemDataBound event (perhaps the easiest way to do this is to use an UserControl). Here are the required steps:
    1. Create a new user control (e.g. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\RadMenu.ascx)
    2. Paste the following code there:
      <%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
          Namespace="Telerik.Web.UI" %> 
      <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" 
          Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
      <%@ Import Namespace="Microsoft.SharePoint" %> 
      <%@ Control Language="C#" AutoEventWireup="true" compilationMode="Always"%> 
      <script runat="server"
      protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e) 
          string target = (string)DataBinder.Eval(e.Item.DataItem, "Target"); 
          if (!string.IsNullOrEmpty(target)) 
              e.Item.Target = target
      <telerik:RadMenu runat="server" ID="RadMenu1" DataSourceID="topSiteMap" OnItemDataBound="RadMenu1_ItemDataBound"
      <SharePoint:DelegateControl ID="DelegateControl1" runat="server" ControlId="TopNavigationDataSource"
    3. Register the control in your master page:
      <%@ Register TagPrefix="wssuc" TagName="RadMenu" src="~/_controltemplates/RadMenu.ascx" %>
    4. Use the control
      <wssuc:RadMenu runat="server" id="RadMenuUserControl"/>

    I hope this helps,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Cameron Hart
    Cameron Hart avatar
    17 posts
    Member since:
    May 2008

    Posted 27 Jan 2010 Link to this post

    I'm about to duplicate this fix now.

    Before I do, since 2008, has the Rad Menu been upgraded to handle this kind of functionality by default? It would be a very useful timesaver.
  4. Peter
    Peter avatar
    6637 posts

    Posted 29 Jan 2010 Link to this post

    Hi Cameron,

    Thanks for your inquiry. Unfortunately, RadMenu has not been extended to handle such scenarios automatically. Please, excuse us for this limitation of the control.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Joaquin
    Joaquin avatar
    1 posts
    Member since:
    Aug 2012

    Posted 12 Aug 2010 Link to this post

    Do you know if the RadMenu has improved or changed that setting in version 2010.1.519?

    I'm having the same issue but I want to know how can I do the control on the sever in the hive 12/TEMPLATES, is that the code, or that is the code that goes in the MasterPage?
  6. Kamen Bundev
    Kamen Bundev avatar
    1532 posts

    Posted 13 Aug 2010 Link to this post

    Hi Jesse,

    No, this feature is not implemented yet, however we are considering to add it soon.

    About your other question - I'm not sure I understand what you are asking. If you follow the steps outlined below, the user control should work (the steps are for SharePoint 2007).

    All the best,
    Kamen Bundev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top