Menu in MOSS

7 posts, 0 answers
  1. Mark
    Mark avatar
    20 posts
    Member since:
    Nov 2006

    Posted 28 Nov 2008 Link to this post

    Hi,

    I'm trying to build a navigation control for Sharepoint using RadMenu. It almost works, in that the menu appears on screen, but the problem I'm having is that the submenus don't open.
    I looked at the HTML source and the submenus have been rendered, but the menu control just won't display them when I rollover.

    I've attached my code below. Any help would be much appreciated!

    <%

    @ Control Language="vb" AutoEventWireup="false" CodeBehind="MOSS_InternetTopMenu.ascx.vb" Inherits="MOSS_InternetSideMenu.MOSS_InternetTopMenu" %>

     

    <%

    @ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

     

    <

    telerik:RadMenu ID="topMenu" Runat="server">

     

    </

    telerik:RadMenu>

     



    Imports

    Microsoft.SharePoint

     

    Imports

    Microsoft.SharePoint.WebControls

     

    Imports

    Microsoft.SharePoint.WebPartPages

     

    Imports

    Microsoft.SharePoint.Publishing.Navigation

     

    Imports

    PublishingWeb = Microsoft.SharePoint.Publishing.PublishingWeb

     

    Imports

    PublishingWebCollection = Microsoft.SharePoint.Publishing.PublishingWebCollection

     

    Imports

    SPWebTemplate = Microsoft.SharePoint.SPWebTemplate

     

    Imports

    Microsoft.SharePoint.Publishing

     

    Imports

    Telerik.Web.UI

     

    Partial

    Public Class MOSS_InternetTopMenu

     

     

    Inherits System.Web.UI.UserControl

     

     


    Private
    currentSite As SPSite

     

     

    Private currentWebRoot As SPWeb

     

     


    Protected
    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

     

     

        If Not IsPostBack Then

     

            currentSite = SPContext.Current.Site

            currentWebRoot = SPContext.Current.Site.RootWeb

     

            If HttpContext.Current.User.Identity.IsAuthenticated = False Then

     

                SPSecurity.RunWithElevatedPrivileges(

    AddressOf Me.PopulateMenu)

     

     

            End If

     

     

        End If

     

     

    End Sub

     

     


    Private
    Sub PopulateMenu()

     

     

        Try

     

     

            Dim elevatedSiteColl As SPSite

     

     

            Dim elevatedWebRoot As SPWeb

     

            elevatedSiteColl =

    New SPSite(currentSite.ID)

     

            elevatedWebRoot = elevatedSiteColl.OpenWeb(currentWebRoot.ID)

     

            Dim rootWeb = PublishingWeb.GetPublishingWeb(elevatedWebRoot)

     

     

            Dim defaultPageUrl As String = rootWeb.DefaultPage.ServerRelativeUrl

     

     

            Dim smnHome As PortalListItemSiteMapNode = DirectCast(PortalSiteMapProvider.CombinedNavSiteMapProvider.FindSiteMapNode(defaultPageUrl), PortalListItemSiteMapNode)

     

     

            
            For
    Each smnTopLevelItem As SiteMapNode In smnHome.ParentNode.ChildNodes

     

     

                Dim NewMenuItem As New RadMenuItem

     

                NewMenuItem.Text = smnTopLevelItem.Title

                NewMenuItem.NavigateUrl = smnTopLevelItem.Url

                topMenu.Items.Add(NewMenuItem)

     

                If smnTopLevelItem.HasChildNodes Then

     

     

                    For Each smnChildItem As SiteMapNode In smnTopLevelItem.ChildNodes

     

     

                        Dim NewChildItem As New RadMenuItem

     

                        NewChildItem.Text = smnChildItem.Title

                        NewChildItem.NavigateUrl = smnChildItem.Url

                        NewMenuItem.Items.Add(NewChildItem)

     

                    Next

     

     

                End If

     

     

            Next

     

     

        Catch ex As Exception

     

     

        End Try

     

     

    End Sub

     

    End

    Class

     

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 28 Nov 2008 Link to this post

    Hi Developer,

    The most common reason for this problem is JavaScript errors. This usually occurs when the web resource http handler is not properly configured. Please check this blog post for additional info on that matter.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mark
    Mark avatar
    20 posts
    Member since:
    Nov 2006

    Posted 28 Nov 2008 Link to this post

    Thanks, I'll have a look.

    My page isn't displaying any Javascript errors though, as far as I can tell the page is loading fine.
  4. Mark
    Mark avatar
    20 posts
    Member since:
    Nov 2006

    Posted 28 Nov 2008 Link to this post

    Unfortunately, that hasn't helped. I ran Fiddler and all seemed fine. And, like I said, the page is showing no Javascript errors. Do you have any other ideas what it could be?

    Many thanks!
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 28 Nov 2008 Link to this post

    Hello Developer,

    Unfortunately I cannot think of any other things which could prevent RadMenu from expanding. Is there any live url where I can observe this behavior?

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Mark
    Mark avatar
    20 posts
    Member since:
    Nov 2006

    Posted 28 Nov 2008 Link to this post

    Unfortunately we don't have this on a live environment at the moment.

    I make sure it wasn't me putting the menu together incorrectly, I hard coded a simple one (code shown below). This worked fine on my local PC, but when I tried to add it to a MOSS site I get the same results.

    <%

    @ Control Language="vb" AutoEventWireup="false" CodeBehind="TestTopMenu.ascx.vb" Inherits="MOSS_InternetSideMenu.TestTopMenu" %>

     

    <%

    @ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

     

    <

    telerik:RadMenu ID="RadMenu1" Runat="server">

     

     

    <Items>

     

     

    <telerik:RadMenuItem Text="Menu 1">

     

     

    <Items>

     

     

    <telerik:RadMenuItem Text="Sub 1"></telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem Text="Sub 2"></telerik:RadMenuItem>

     

     

    </Items>

     

     

    </telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem Text="Menu 2">

     

     

    <Items>

     

     

    <telerik:RadMenuItem Text="Sub 3"></telerik:RadMenuItem>

     

     

    <telerik:RadMenuItem Text="Sub 4"></telerik:RadMenuItem>

     

     

    </Items>

     

     

    </telerik:RadMenuItem>

     

     

    </Items>

     

    </

    telerik:RadMenu>

     

  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 28 Nov 2008 Link to this post

    Hi,

    Unfortunately I cannot see why this problem is happening. Please check whether some CSS rule of your MOSS site is not preventing the menu from opening. Check for any rules containing "display:none !important" or something similar.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top