views:

173

answers:

2

I've got a SiteMap with blank URL attributes in each siteMapNode. Anyone know how to render them if the URL is blank? I'm doing a foreach against the SiteMap.CurrentNode and it doesn't retrieve siteMapNode elements that have empty URL attributes, but I do need to render them (just without a URL).

Any ideas?

A: 

I do not know it's good or bad practice. But generally for such requirement I do use string "#" as empty url. It serves empty url purpose.

Saar
A: 

To render a site map node with a blank URL, simply remove the URL attribute altogether from the node. It will then render, but not be clickable (if you are using security trimming, include the roles attribute, e.g. roles="*" or e.g. roles="Admin" since there is no URL to authorize against.)

Jacob