Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 17th, 2006, 10:28 PM
Authorized User
Join Date: Apr 2004
Location: , , .
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default sitemap and navigation help

I'm new to asp.net and one thing I have been struggling to understand the web.sitemap and navigation controls for several days.

Here is the problem. I have created my sitemap file and I want to create three individual menus...i.e. a top navigation bar, a main navigation bar and a left navigation bar.

Here is a url to see the exact three menus I am trying to create from the sitemap file: http://www.compasslearning.com/about_us/index.asp

Is there a way to filter a sitemap file?

For example, if I create the following user control:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TopNavigationBar.ascx.cs" Inherits="UserControls_TopNavigationBar" %>
<asp:Repeater runat="server" ID="siteMapAsBulletedList" DataSourceID="SiteMapDataSource1">
            <li><asp:HyperLink runat="server" ID="lnkHome" NavigateUrl='<%# SiteMap.RootNode.Url %>' Text='<%# SiteMap.RootNode.Title %>'></asp:HyperLink></li>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("Url") %>' Text='<%# Eval("Title") %>'></asp:HyperLink>
<asp:SiteMapDataSource ShowStartingNode="false" ID="SiteMapDataSource1" runat="server" />

Here is my web.sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/index.aspx" title="Home">
    <siteMapNode url="~/about_us/index.aspx" title="About Us">
      <siteMapNode url="~/about_us/mediaroom.aspx" title="Media Room" />
      <siteMapNode url="~/about_us/awards.aspx" title="Awards" />
      <siteMapNode url="~/about_us/employment.aspx" title="Employment Opportunities" />
      <siteMapNode url="~/about_us/events.aspx" title="Trade Show Calendar" />
      <siteMapNode url="~/about_us/partners.aspx" title="Partners and Alliances" />
      <siteMapNode url="~/about_us/wrcmedia.aspx" title="WRC Media" />
      <siteMapNode url="~/contact.aspx" title="Contact Us" />
      <siteMapNode url="http://support.compasslearning.com" title="Customer Support" />
      <siteMapNode url="~/sitemap.aspx" title="Site Map" />
    <siteMapNode url="~/technology/index.aspx" title="Technology">
      <siteMapNode url="~/technology/subscription.aspx" title="Odyssey Subscription" />
      <siteMapNode url="~/technology/hosted.aspx" title="Odyssey Hosted" />
      <siteMapNode url="~/technology/enterprise.aspx" title="Odyssey Enterprise" />
      <siteMapNode url="~/research/index.aspx" title="Research" />
    <siteMapNode url="~/assessment/index.aspx" title="Assessment">
      <siteMapNode url="~/assessment/custom.aspx" title="Custom Assessment" />
      <siteMapNode url="~/assessment/explorer.aspx" title="CompassLearning Explorer" />
    <siteMapNode url="~/curriculum/index.aspx" title="Curriculum">
      <siteMapNode url="~/curriculum/prek.aspx" title="Pre-K" />
      <siteMapNode url="~/curriculum/reading.aspx" title="Reading/Language Arts" />
      <siteMapNode url="~/curriculum/writing.aspx" title="Writing" />
      <siteMapNode url="~/curriculum/math.aspx" title="Mathematics" />
      <siteMapNode url="~/curriculum/spanmath.aspx" title="Matemáticas" />
      <siteMapNode url="~/curriculum/science.aspx" title="Science" />
      <siteMapNode url="~/curriculum/socialstudies.aspx" title="Social Studies" />
      <siteMapNode url="~/curriculum/crosscurricular.aspx" title="Cross Curricular" />
      <siteMapNode url="~/curriculum/ell.aspx" title="English Language Learners" />
      <siteMapNode url="~/curriculum/specialneeds.aspx" title="Children with Spcial Needs" />
      <siteMapNode url="~/curriculum/secondary.aspx" title="Secondary" />
    <siteMapNode url="~/data_management/index.aspx" title="Data Management">
      <siteMapNode url="~/data_management/students.aspx" title="Managing Students" />
      <siteMapNode url="~/data_management/standards.aspx" title="Managing Standards" />
      <siteMapNode url="~/data_management/reporting.aspx" title="Managing Reporting" />
    <siteMapNode url="~/services/index.aspx" title="Services">
      <siteMapNode url="~/services/custservice.aspx" title="Customer Service" />
      <siteMapNode url="~/services/implementservice.aspx" title="Implementation Services" />
      <siteMapNode url="~/services/supportplan.aspx" title="Annual Support Plans" />
      <siteMapNode url="~/services/options.aspx" title="More Options" />
      <siteMapNode url="~/services/prodev.aspx" title="Professional Development" />
    <siteMapNode url="~/results/index.aspx" title="Results">
      <siteMapNode url="~/results/research.aspx" title="Product Research" />
      <siteMapNode url="~/results/achievement.aspx" title="Achievement Results" />

The menu displays the following:

Home | About Us | Contact Us | Customer Support | Site Map | Technology | Research | Assessment | Curriculum | Data Management | Services | Results

I want to filter the menu so it only displays:

Home | About Us | Contact Us | Customer Support | Site Map

I'm going to have other menus on my page...i.e. a left navigation bar and a main navigation bar, which I would want to display different nodes than the top navigation.

I haven't been able to figure out how to filter out the specific nodes I want to include in each menu.

Is the sitemap structure incorrect. Is this possible to do with the sitemap? Is there another method to achieve this? I'm not sure where I'm going wrong.

Any help is greatly appreciated.

Thank you.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sitemap melania ASP.NET 3.5 Basics 0 October 27th, 2008 01:20 PM
SiteMap Navigation question Quick209 ASP.NET 2.0 Professional 5 August 30th, 2006 12:44 AM
Web.Sitemap Tremmorkeep BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 July 21st, 2006 05:32 PM
chapter 3 sitemap try it out diango BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 16th, 2006 11:40 AM

All times are GMT -4. The time now is 01:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.