Role based menu

G

Guest

Hi All,

I am developing an ASP.NET 2.0 application.

I want to show the menu, depending on the user role.

How can I implement that?

Currently I store all the menu details in XML file and using DataList to
render link buttons in Tabular format.

Any pointer?

TIA
Sachin
 
S

Shahzad Godil

Is your menu details in SiteMap file or in XML File?

Create a sitemap file and store your menu structure in sitemap file. And
then rest of work related to showing only those menus which are allowed to
that particular user will be done by asp.net.

See this article how it will work and how SecurityTrimming will work.
Thankfully, ASP.NET 2.0's site navigation provides a feature called security
trimming. When obtaining site map information with security trimming
enabled, only those site map nodes that the currently logged on user has
authorization to visit are available. That means the site's TreeView or Menu
will contain just those sections accessible by the currently logged in user.
Read on to learn how to configure site navigation to support security
trimming!

http://aspnet.4guysfromrolla.com/articles/122805-1.aspx


Shahzad Godil
Karachi-Pakistan.
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top