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: 3/4/2007 3:05:58 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 19 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
burras
Asp.Net User
Creating page specific menus from site nodes3/4/2007 3:05:58 PM

0/0

Hi guys,

Ive used the Corporate template to start. I want to create a sub menu within pages using the .master file, but Im having difficulty configuring the SiteNodes in the .sitemap file to get the output I want.

The site is about motorbikes, so as a brief description this is want Im try to achieve:

Homepage > Manufacturers Page > Select a Manufacturer Model > submenu appears providing 4 sub menus for each model (model, bikenoise, more photos, and tech spec)

At the moment I have 2 bike models, but the submenu shows the submenu options for both models, rather than the specific model.

Some help would be much appriciated!

Sitemap:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/Default.aspx" title="Home"  description="Return To Home Page">
    <siteMapNode url="~/Manufacturers/ManufacturerList.aspx" title="Manufacturers"  description="Search By Manufacturers">
    </siteMapNode>
    <siteMapNode url="~/Section2/Default.aspx" title="About Us"  description="Who We Are">
    </siteMapNode>
    <siteMapNode url="~/Contact.aspx" title="Contact"  description="Contact Us">
    
   
      <siteMapNode url="~/Manufacturers/Kawasaki/Kawasaki.aspx" title="Kawasaki"  description="Kawasaki" >
      </siteMapNode>
     
      <siteMapNode url="~/Manufacturers/Kawasaki/ZX7-R/ZX7-R.aspx" title="ZX7-R Ninja"  description="ZX7-R Ninja">
        <siteMapNode url="~/Manufacturers/Kawasaki/ZX7-R/TechSpec.aspx" title="Technical Spec"  description="Kawasaki ZX7-R Ninja Technical Specification" />
        <siteMapNode url="~/Manufacturers/Kawasaki/ZX7-R/BikeNoise.aspx" title="BikeNoise Clips"  description="Kawasaki ZX7-R Ninja Exhaust Note Sound Files" />
        <siteMapNode url="~/Manufacturers/Kawasaki/ZX7-R/Pictures.aspx" title="More Photos"  description="Kawasaki ZX7-R Ninja Photo Gallery" />
      </siteMapNode>
       
      <siteMapNode url="~/Manufacturers/Kawasaki/ZXR400/ZXR400.aspx" title="ZXR400"  description="ZXR400">
       <siteMapNode url="~/Manufacturers/Kawasaki/ZXR400/TechSpec.aspx" title="Technical Spec"  description="Kawasaki ZXR400 Technical Specification" />
       <siteMapNode url="~/Manufacturers/Kawasaki/ZXR400/BikeNoise.aspx" title="BikeNoise Clips"  description="Kawasaki ZXR400 Exhaust Note Sound Files" />
       <siteMapNode url="~/Manufacturers/Kawasaki/ZXR400/Pictures.aspx" title="More Photos"  description="Kawasaki ZXR400 Photo Gallery" />
     </siteMapNode>
    </siteMapNode>
  </siteMapNode>  
</siteMap>

master.vb file: 

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

 

Ive spent days messing around trying to get this to work, and still no joy...Please can someone help! 

Cheers,
Sam

orka777
Asp.Net User
Re: Creating page specific menus from site nodes3/5/2007 8:48:01 PM

0/0

it seems like you embedded all your stuff in  <siteMapNode url="~/Contact.aspx" title="Contact"  description="Contact Us"> 

try to close the siteMapNode and see if that works <siteMapNode url="~/Contact.aspx" title="Contact"  description="Contact Us" / > 


Orka
burras
Asp.Net User
Re: Creating page specific menus from site nodes3/6/2007 11:50:54 AM

0/0

Cheers for the reply orka,

Ive closed the "Contact Us" siteMapNode, which has resolved the submenu issue, each model now has the correct submenu options, however the "Kawasaki" page, and both models now appear in the master page navigation buttons.  Is it possible to create dynamic sub-menus without adding each page to the master menu with only one siteMap? 

burras
Asp.Net User
Re: Creating page specific menus from site nodes3/6/2007 12:24:15 PM

0/0

Ive done some research into the terminology so hopefully this will make it clearer as to what I want to achieve...

Is it possible to have 2 static menus derived from the same sitemap?  One would be "Home", "Contact Us", "About Us", and "Manufacturer" fixed at the top of the screen through a master page,  the second being the individual "Model", "BikeNoise", "Photos", and "Tech Spec" that change to match the current model the user is viewing?

 Sorry for being a complete newbie, this is the first real web design Ive done for a while and I just really want to get it to work! Smile

burras
Asp.Net User
Re: Creating page specific menus from site nodes3/6/2007 12:25:03 PM

0/0

Ive done some research into the terminology so hopefully this will make it clearer as to what I want to achieve...

Is it possible to have 2 static menus derived from the same sitemap?  One would be "Home", "Contact Us", "About Us", and "Manufacturer" fixed at the top of the screen through a master page,  the second being the individual "Model", "BikeNoise", "Photos", and "Tech Spec" that change to match the current model the user is viewing through a seperate masterpage?

 Sorry for being a complete newbie, this is the first real web design Ive done for a while and I just really want to get it to work! Smile

orka777
Asp.Net User
Re: Creating page specific menus from site nodes3/10/2007 3:32:55 AM

0/0

Yes, it will need to play with StartingNodeUrl. Note that you might need to create extra page

  <asp:SiteMapDataSource  StartingNodeUrl="~/ShowManufacturers.aspx...


Orka
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Pro Drupal Development Authors: John K. VanDyk, Dries Buytaert, Pages: 704, Published: 2008
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Learning EZ Publish 3: Building Content Management Solutions Authors: Paul Borgermans, Tony Wood, Paul Forsyth, Ben Pirt, Bjorn Dieding, Pages: 392, Published: 2004
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
ASP.NET 2.0 All-In-One Desk Reference For Dummies: all-in-one desk reference for dummies Authors: Doug Lowe, Jeff Cogswell, Ken Cox, Pages: 910, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Visual Studio 2008 All-In-One Desk Reference For Dummies Authors: Rick Leinecker, Vanessa L. Williams, Pages: 816, Published: 2008
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007

Web:
How to create a web page with scrolling menus to specific entries ... How to create a web page with scrolling menus to specific entries ... How can I create Frames in my web page? (Site Layout and Usability) ...
ASP.NET Site Navigation Overview With the TreeView or Menu controls, users can open nodes and navigate directly to a specific page. These controls do not directly read the site map, ...
Access Control | drupal.org Feb 6, 2008 ... administer menu: allows use to access the administer menus page ... nodes: Allows the user to create, edit, and delete nodes of all types. ...
Drupal for Organizations: Part I - Site Architecture | Geoff Hankerson Use the menu module to create menus for the home page and each sub section of ... to make menus only show up on certain pages(nodes) and nodes in a specific ...
Creating a Custom Home Page in Drupal Using Views | A Padded Cell Jun 29, 2007 ... Select Create Content -> Page in the Drupal administrator menu (in .... Under Page specific visibility settings select the Show on only the ...
webgen - static website generator - FAQ To stop the template chain at a specific template or even at the page file ... create a static menu? You can use virtual nodes to define virtually any menu ...
How to get started with Drupal | David Lanier Some things that are NOT nodes are: comments, users, blocks, menus, and taxonomy . ... Page - is everything that shows up when you load a specific URL. ...
Optimizing Web Site Navigation Additionally, a node specific outer navigation, e.g. a left handed menu, ... The content linked on a site map page or on a horizontal index should be ...
Creating Menu Item for a Specific List/Document Library Template ... We now need to add a CustomAction node inside of the elements node below the listtemplate area. The custom action is what is used to create our new menu ...
"Welcome to your new Drupal website!" in menu: Navigation ... Under Content, there is a sub-menu item 'Create Content,' which takes you to the ... In case you want a specific page to be the front page, ...

Videos:
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming environmen...




Search This Site:










changing the display order of the sqlsitemap

master page and panel

how to disable the sidebarlist buttons in wizard control

loading controls dynamically in content page and firing the js events and codebehind events

wizard control + separate aspx pages

space between 2 table rows

cannot edit masterpage content in vs 2008

global master page

updatable sitemapprovider

menu control - making parent node not clickable

removing specific treeview nodes based on custom attributes using treenodedatabound

master page

problem with masterpage

menu item without explicit url (assuming default.aspx page) does not get selected property

retain theme

creating a tab menu using "menu control and web.sitemap

publicly expose specific controls in masterpage (can it be done?)

[c#] change the session culture

menu control with tab effect

gridview page flip: the file web.sitemap required by xmlsitemapprovider does not exist.

masterpages, form-tags, etc....

masterpage & button event

menu control item selection issue

changing the id attribute of the body tag in a masterpage?

strange formatting problem when using masterpages.

create custom collectionform

sitemap navigation problem

asp.net menu not working in 2003 server.

mailto: in a web.sitemap

adding a "master" page

  Privacy | Contact Us
All Times Are GMT