473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select parent nodes in sitemap when any of its children are selected

I'm in the process of building some navigation for a website. I would
like to use the capabilities of the sitemap in asp.net but have ran
into some styling/usability issues in the past using just the default
controls that consume the sitemap. I'd like to know of there is a
correct/recommended way of doing the following:

1.. Build a horizontal navigation bar with a set of top level
navigation

2. When a child page is selected the parent node on the navigation bar
should be selected as well

3. When a child page is selected under the parent node but uses a
query string or an implied file name it should also select the parent
node.

Here's some examples:

-- Problem #1: / and /default.aspx no the the same in the eyes of
the sitemap
If I had a parent navigation bar category called Books, then went
to example.com/Books/Default.aspx the sitemap as-is would recognize to
highlight the books category. I also want this to happen when I go to
example.com/Books where Default.aspx is what is loaded by IIS but it
is not explicitly stated when the user enters the URL, when using the
default sitemap functionality in asp.net the sitemap does not
recognize that Default.aspx is selected since its not explicitly
expressed in the url. How would I make example.com/Books and
example.com/Books/Default.aspx equivalent to the controls consuming
the sitemap?
-- Problem #2:
Let's say that I have the same books category but I also have
another page called Meetups.aspx under it. When this page is selected
I also want the books category / parent node to realize it is selected
and display as such in my navigation bar. I also want parent to select
when a query string is used on this page. i.e. Meetups.aspx?
sate=IN&zip=460 32 should also highlight the Books parent node and
ideally would be the same as Meetups.aspx when not using the query
string. The default asp.net sitemap controls don't seem to allow this
either.
The last time I worked with sitemaps was in .NET 2.0, and I'm now
using 3.5, didn't know if the support for sitemaps are any better in
the new version? Is thee a correct way to get this functionality from
the out of the box controls or will I have to code my own custom
solution? Any suggestions or references to resources would help.
Thanks!

Oct 6 '08 #1
0 1561

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4620
by: Drulli Rokk | last post by:
Hi, Here's a question that has cost this newbie two days of headache already: How can I get my XSLT stylesheet to specify a maximum number of elements to process? I'm now using <xsl:for-each> which processes all the child-nodes at the particuar point in my XML (RSS) file. But what I really want, is this: if number of child-nodes > n then process only the first n
0
2902
by: Walt Borders | last post by:
Hi, My problem: Merging two datasets deletes parent elements, preserves all children. I've created two dataSets. Each use the same schema, parent-child nested tables. The first dataSet is loaded with historical data read from an XML file. The second dataSet has current data filled from a dataGrid.
1
1960
by: clintonG | last post by:
How do I get a TreeNode.Parent property when using the 2.0 TreeView control? When the data source is an XML file there may be redundant names in the tree. For example, when a child node with the value of 'name' is selected I don't have a clue how to get the name of its parent which may be 'person' or 'school.' <%= Clinton Gallagher
6
1758
by: Paul J Lay | last post by:
I am using the XmlDocument Select Nodes method and it seems to work OK except that it returns embedded nodes in the collection when I only want the nodes that are not embedded. For example I have a statement as follows: nodes = doc.SelectNodes(\\Node1\\Node\\DesiredNode); It gives me back in the collection all the DesiredNode tags. If I select retrieve the nth node as follows node = nodes;
0
2741
by: JJ | last post by:
Hi All, I am trying to Add nodes in code behind and am having problems with the parent child relationships. I get a Use of unassigned local variable error . I have the local variables defined and in my switch statement I build the parent Nodes and have children created off of them. What am I doing wrong? Here is the code:
7
3770
by: amruta | last post by:
the code below dows not let me get the parent child view... all the nodes are show in one line only... also i need them to be collasped ... Thanks ..
2
23957
by: Ettenurb | last post by:
I was hoping someone has come across this and came up with a solution. We have upgraded our custom software to us Infragistics UltraWinGrid 2006 CLR 2.0. The code below worked with a previous release of the UltraWinGrid. When the user clicks on the 'Select All' button this code is selecting all rows in the grid. The grid has band(0) and band(1) (Parent and multiple children)
5
2022
by: Gregor Kofler | last post by:
Refactoring my old DualSelectBox , I thought it would be much smarter to get rid of the new Option() stuff, and instead just switch childNodes between the two select elements. Something like that: function shiftSelectedOptions(src, dest) { var i, len, opts = ; for(i = 0, len = src.options.length; i < len; i++) { if (src.options.selected) { opts.push(src.options); }
5
3685
by: AdrianGawrys | last post by:
Hi Guys, I have an xml similar to this one: <?xml version="1.0" encoding="UTF-8"?> <SystemUpdate ForceUpdate="false" > <A ForceUpdate="false"> <Book name="Black" /> <Book name="BlackRed" />
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.