Posts

Showing posts with the label SiteMap

How to remove a MenuItem base on condition

There may be an easier solution, which is to use the MenuItemDataBound event. I use this to hide menu nodes from the Menu Controller . Keeping them in the siteMap allows them to appear in the Menu Controller , but I don't want them in the Menu Controller based on the Roles attribute . Here's my code: The SiteMap File <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >     <siteMapNode url="" title=""  description="">         <siteMapNode url="#" title="Home" roles="*"  description="This is Homepage" />         <siteMapNode url="" title="About" roles="*"  description="This About Page" />         <siteMapNode url="_#" title="Product" roles="ADMIN" description="This is Product Page, Only Role Admin Can access"...