XmlSiteMapProvider uses url as key - mistake?

M

Martin

Isn't it a mistake for XmlSiteMapProvider to use the url as the node key?

What if you want to change the url? The node and the url should be
decoupled, via a distinct key which does not change. Also what if you have
a number of different sitemaps for different scenarios. One way to abstract
between them is to have a consistent set of node keys - again this is not
possible with the current implementation.

I think MS made a mistake here.

:-(

Martin
 
A

Alan Silver

Martin <[email protected]> said:
Isn't it a mistake for XmlSiteMapProvider to use the url as the node key?

What if you want to change the url?

So change it, what's the problem? You are effectively changing the node
key (to use you words), but so what?
The node and the url should be
decoupled, via a distinct key which does not change. Also what if you have
a number of different sitemaps for different scenarios. One way to abstract
between them is to have a consistent set of node keys - again this is not
possible with the current implementation.

I think MS made a mistake here.

I don't. The only drawback I have found is that you can't use the same
URL in more than one place in the site map, which is something I
occasionally want to do. I have got around this by adding some spurious
query string to the URL.

Maybe if you explained your problem more clearly it would help.
 
M

Martin

XmlSiteMapProvider has a method FindSiteMapNodeFromKey.

I'm saying it's more useful to have a key that won't change during the
product/software life cycle.

The scenario I can envisage is a node for the search page (for example)

It would be good to be able to give this node the key "search", and be able
to find it with the above method. The url should be another attribute of
the node. Perhaps key is just defaulting to the same value as url, and if I
set key attribute explicitly it will have a distinct value. I'll try that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top