menu anchor tags

1 posts, 0 answers
  1. Sebastian
    Sebastian avatar
    2 posts
    Member since:
    May 2011

    Posted 10 Oct 2012 Link to this post


    I use the version 2012.2.913 of Kendo UI for ASP.NET MVC. This is the code to build the menu, inspired by the Kendo UI Demo:
        var MainMenu = Html.Kendo().Menu().Name("MainMenu").Orientation(MenuOrientation.Horizontal); 
        foreach (var NavigationItem in Model.NavigationTree.OrderBy(Item => Item.DisplayOrder)) 
            var Item = NavigationItem; 
            if (Item.SubNavigationItems.Any()) 
                MainMenu.Items(Items => Items.Add().Text(Item.Name).Content(@<text>@Html.Partial(MVC.Shared.Views.SubNavigation, Item.SubNavigationItems)</text>)); 
                MainMenu.Items(Menu => Menu.Add().Text(Item.Name).Content(@<text>@Html.Raw(File.ReadAllText(Server.MapPath(@"~/HtmlContent/Menu." + Item.Name + ".html")))</text>)); 

    And this is the output:
    <div id="mainmenu"
      <ul class="k-widget k-reset k-header k-menu k-menu-horizontal" id="MainMenu" data-role="menu"
        <li class="k-item k-state-default k-first"
          <a class="k-link" href="#MainMenu-1"
            Service Management 
            <span class="k-icon k-i-arrow-s"></span
          <ul class="k-group"
            <li class="k-item k-state-default k-first k-last"
              <div class="k-content" id="MainMenu-1"

    My problem is the "#MainMenu-1" anchor link. If I click on the link, the page jumps to the target of course! The output of the Kendo UI Demo has no anchor link in this area.

    How I can suppress or remove the anchor link?

    What I'm doing wrong?
Back to Top