CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/22/2006 8:33:54 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
zebedeu
Asp.Net User
Menu Control - Disappears in subpages8/22/2006 8:33:54 PM

0/0

Hi,

I'm sure this has been a fairly discussed issue, so I appoligize in advance, but I haven't found any answers regarding this issue.

I have a Menu Control in a Master Page. The Menu Control is filling up with the XML from the SiteMapDataSource.

The problem I'm having is that once I'm surfing the site, and I reach a child page, like in this case Company History, the menu disappears and leaves behind only the link to the page i'm actually at. I know bread crumbs could solve this problem, but I need the menu to persist in a static condition in all sub pages of "About Us", and ONLY once I surf to "About Us" - so users can go from subpage to subpage directly.

The Web.SiteMap has this:

<

siteMapNode url="~/Section1/Default.aspx" title="About Us" description="Section 1 Landing Page">

<siteMapNode url="~/Section1/Page1.aspx" title="Company History" description="Page 1 of Section 1" />
<siteMapNode url="~/Section1/Page2.aspx" title="Completed Projects" description="Page 2 of Section 1" />
<
siteMapNode url="~/Section1/Page3.aspx" title="Testimonials" description="Page 3 of Section 1" />

<
siteMapNode url="~/Section1/SubSection1/Default.aspx" title="Restoration Services" description="Subsection 1 Landing Page">
<
siteMapNode url="~/Section1/SubSection1/Page1.aspx" title="Completed Jobs" description="Page 1 of Subsection 1" />
<
siteMapNode url="~/Section1/SubSection1/Page2.aspx" title="Range of Services" description="Page 2 of Subsection 1" />
<
siteMapNode url="~/Section1/SubSection1/Page3.aspx" title="Pictures" description="Page 3 of Subsection 1" />
</
siteMapNode>
</
siteMapNode>


THANK YOU!
lostlander
Asp.Net User
Re: Menu Control - Disappears in subpages8/23/2006 3:39:50 AM

0/0

It's weird that the menu dissapears.

Would you provide more information? You may paste here your web.config , web.sitemap , masterpage, the page uses masterpage...

Here is my code, hope it helps:

web.sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/Admin/AdminLogin.aspx" title="Login" description="Login">  
      <siteMapNode url="~/Admin/Applicant.aspx" title="Primary Applicant" />
      <siteMapNode url="~/Admin/Details.aspx" title="Review Applications"/>
      <siteMapNode url="~/Admin/NewUser.aspx" title="Add New User"/>     
      <siteMapNode url="~/All.aspx" title="currentpage:All.aspx"/>
  </siteMapNode>
</siteMap>

masterpage.master:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage1.master.cs" Inherits="MasterPage1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
        </asp:contentplaceholder>
        &nbsp;
        <asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" Width="112px">
        </asp:Menu>
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
    </div>
    </form>
</body>
</html>

the page user Master, useMaster.aspx:

<%@ Page Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="useMater1.aspx.cs" Inherits="useMater1" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

zebedeu
Asp.Net User
Re: Menu Control - Disappears in subpages8/23/2006 1:25:47 PM

0/0

Hi, Thanks for your reply!

Here's the code on my master.master.vb page
I believe this is the only code that might have something to do with the way the menu is rendered (besides the web.sitemap)

Thanks!

Partial

Class AppMaster
Inherits MasterPage

''' <summary>
''' Event handler that highlights the top level menu section for all
''' sections and pages below it.
''' </summary>

Protected Sub MainMenu_MenuItemDataBound(ByVal sender As Object, ByVal e As MenuEventArgs)

If mainmenu.SelectedItem Is Nothing Then
If IsNodeAncestor(CType(e.Item.DataItem, SiteMapNode), System.Web.SiteMap.CurrentNode) Then
e.Item.Selected = True
End If

End If
End Sub

''' <summary>
''' Determines if a <see cref="System.Web.SiteMapNode"/> is the ancestor of a second one.
''' </summary>
''' <param name="ancestor">The <see cref="System.Web.SiteMapNode"/> in question.</param>
''' <param name="child">A <see cref="System.Web.SiteMapNode"/> which may or may not be
''' the <paramref name="ancestor"/>'s child.</param>
''' <returns><c>true</c>, if the two nodes are related, <c>false</c> otherwise.</returns>

Private Function IsNodeAncestor(ByVal ancestor As SiteMapNode, ByVal child As SiteMapNode) As Boolean

Dim result As Boolean = False
If Not ancestor.ChildNodes Is Nothing AndAlso ancestor.ChildNodes.Contains(child) Then
Return True
Else
If (Not child.ParentNode Is Nothing) AndAlso (Not ancestor Is child.RootNode) Then
Return IsNodeAncestor(ancestor, child.ParentNode)

End If
End If

Return result
End Function
End
Class
lostlander
Asp.Net User
Re: Menu Control - Disappears in subpages8/24/2006 9:05:47 AM

0/0

Here is my web.sitemap:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/Default.aspx" title="Home_Default"  description="">
        <siteMapNode url="~/Section1/Default.aspx" title="About Us" description="Section 1 Landing Page">
        <siteMapNode url="~/Section1/Page1.aspx" title="Company History" description="Page 1 of Section 1" />
        <siteMapNode url="~/Section1/Page2.aspx" title="Completed Projects" description="Page 2 of Section 1" />
        <siteMapNode url="~/Section1/Page3.aspx" title="Testimonials" description="Page 3 of Section 1" />
            <siteMapNode url="~/Section1/SubSection1/Default.aspx" title="Restoration Services" description="Subsection 1 Landing Page">
                <siteMapNode url="~/Section1/SubSection1/Page1.aspx" title="Completed Jobs" description="Page 1 of Subsection 1" />
                <siteMapNode url="~/Section1/SubSection1/Page2.aspx" title="Range of Services" description="Page 2 of Subsection 1" />
                <siteMapNode url="~/Section1/SubSection1/Page3.aspx" title="Pictures" description="Page 3 of Subsection 1" />
            </siteMapNode>
        </siteMapNode>
    </siteMapNode>
</siteMap>

I've copied the exact code in your post to the MasterPage.master. All the pages above use this master. And it works well for me. I recommend you do a separate test with another blank project.

Or,

you can paste more code here. like web.config. web.sitemap ( whole file ) etc. 

Good luck! ^_^

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
JavaScript: The Missing Manual Authors: David McFarland, David Sawyer McFarland, Pages: 500, Published: 2008

Web:
SilverStripe Website Builders and Developers Forum <% control Menu(1) %>
  • THE EWS STRESS CONTROL PANEL: SoundSystem DMX section [subpage ... Most sequencer programs have a menu item labeled "Setup/MIDI Devices", ... Check the control settings of the WAVE control in the DMX ControlPanel. ...
    [TYPO3-dev] itemArrayProcFunc inconsistent behaviour when no sub ... Sep 23, 2007 ... My problem: If the page on which the menu is to be inserted contains no actual sub-pages, the menu does not appear. ...
    LVP-XD10U LVP-SD10U (KEYSTONE+) to select the sub-pages. (The main OSD menu will automatically disappear. if no key is pressed within 10 seconds). ...
    Volksbox Corner: Download "Menu" key recalls page 100 - "TV" key causes the current page to disappear but teletext remains alive in the background and new pages and subpages are ...
    dropdown menu problem - ProgrammingTalk I have a dynamic admin where i can create pages and subpages. ... var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) ...
    KaTaLyzer – framework for Ethernet traffic analysis Entering this subpage, News&Links pane from left. disappears and new data presentation menu is displayed on. the right. This menu allows user to choose from ...
    Gimp Plugin for Minolta RAW Files The Presets subpage lets you select the desired color balance from a menu of preset color balances or automatic white balance algorithms. ...
    WordPress plugin: Flexi Pages Widget | Srini's WordPress Laboratory Flexi Pages Widget is a highly configurable widget to list pages and sub-pages in WordPress sidebar. User friendly widget control comes with plenty of ...
    Struggling with 2-level tabbed navigation using CSS "sliding-doors ... I'd prefer to use distinct sub-pages and the Menu control linked to a .... you will see the tabs start to disappear behind the subform. ...




  • Search This Site:










    what is master page?....

    database driven themes

    newbie question re: contentplaceholder

    menu control

    how to change the hyperlink(maybe navigation menu) saved in masterpage the dynamic linked address?

    wizard control

    define device filter for a page

    menu parent backcolor when hovering child menu

    share the same masterpage file between different websites? (newbie)

    populate tree view with sql server

    window.history.go problem

    how to add data to the content place holder at runtime

    sitenavigation problems

    multiple codebehind files of master/aspx/ascx-files inherit from custom base-class

    theme manager...

    tree menu control event

    custom errors with masterpage question

    pages rights for each user

    regarding treeview's treenode checked change

    ff and ie incompatibility

    why i'm getting this error? is this something wrong

    asp.net 2.0 maintaining treeview state in a usercontrol

    how to make menu button background clickable?

    spooky -- menu pops to left in firefox!

    how to get focus back to the scroll position on post back

    multiple horizontal menus with one sitemap file

    button image for each top level menu item - .net 2.0 menu control

    menu & sitemap problem...

    css editor

    menu control: set css class of ancestor menu item of current page

      Privacy | Contact Us
    All Times Are GMT