Empty URL in SiteMapNode

I have a SiteMap with empty URL attributes in each siteMapNode. Does anyone know how to display them if the url is empty? I am doing a foreach against SiteMap.CurrentNode and not extracting siteMapNode elements that have empty URLs, but I need to render them (just without a URL).

Any ideas?

+4
source share
2 answers

I don’t know if this is a good or bad practice. But in general, for this requirement, I use the string "#" as an empty URL. It serves for an empty URL target.

-one
source

To display a site map of a node with an empty URL, simply remove the entire URL attribute from the node. Then it will be displayed, but will not be accessible for clicks (if you use security trimming, include the role attribute, for example role = "*" or, for example, role = "Admin", since there are no URLs for authorization.)

+6
source

All Articles