Advertisements

As for the disable certain MenuItem in ASP.NET menu control, do you mean
make the menuitem hidden from those unauthorized users or still display
them but not provide hyperlink?

Based on my understanding, ASP.NET 2.0 Menu control and the SiteMap
provider provide a security trimming feature which can help control the
visiblility of navigation items(from web.sitemap file) in Menu or TreeView
control. The display rule is depend on two settings:

1. The <authorization> setting will always be checked first, if a user
doesn't have access to a sitemapnode according to this setting, the
corresponding item(in menu or treeview) will be hidden, otherwise, the item
will be displayed.

2. In each <siteMapNode> it has a "roles" attribute that can help you add
additional customize (based on the former setting in #1). If a user can not
access a sitemapnode(its url) according to <authorization> setting, you can
add it into that certain <siteMapNode>'s "roles" attribute so that the user
can still see the node in Menu or TreeView control(though he still can not
navigate to the actual url/page).

Here are the MSDN reference and a good blog article that demonstrate this
feature:

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) athttp://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!