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

menu anchor tags

0 Answers 151 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 10 Oct 2012, 03:52 PM
Hi,

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>)); 
        
        else
        
            MainMenu.Items(Menu => Menu.Add().Text(Item.Name).Content(@<text>@Html.Raw(File.ReadAllText(Server.MapPath(@"~/HtmlContent/Menu." + Item.Name + ".html")))</text>)); 
        
    
@MainMenu

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
      </a
      <ul class="k-group"
        <li class="k-item k-state-default k-first k-last"
          <div class="k-content" id="MainMenu-1"
               ........ 
          </div
        </li
      </ul
    </li
    ........ 
  </ul
  <script
    jQuery(function(){jQuery("#MainMenu").kendoMenu({});}); 
</script
</div>

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?

No answers yet. Maybe you can help?

Tags
Menu
Asked by
Sebastian
Top achievements
Rank 1
Share this question
or