473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Multiple Menus Structures required

Hi,

I am building a new site where I want to utilise the new Menu control
feature with .Net 2.0.
I can see how this normally works, ie. by defining a SiteMapDataSource
control and use of the map.sitemap xml file which defines the menu
nodes & sub-nodes that will be used to build the menu.

My problem is this : I want the menu displayed to be dependent on the
role of the logged on user. If an Administrator logs in, I want to
display a very different menu to that which is to display when a
standard user logs in.

Is this possible ? I really need multiple versions of the web.sitemap
file .. & use the appropriate file for the role of the user. But, I
the web.sitemap is something that loads at application startup
apparently - and is shared for all users of the app in that case.

Surely this must be a common requirement (?)

Can anyone suggest anything ?

Thanks!
Bazza

Mar 8 '07 #1
2 2265

Sorry ... ignore that post.

I can now see how this is done when I take a decent look in an example
map.sitemap file .. I see that for each node I can define the roles
that can see that node rendered in the menu...
eg. roles="ProjectManager,ProjectAdministrator"

Cheers,
Bazza

Mar 8 '07 #2
Hello Bazza,

What you want to do is doable with the asp.net membership provider and the
web.sitemap file. In the web.sitemap file specify the roles you want to for
each menu entry:
=-=-
<siteMapNode url="~/Admin/admin.aspx" title="Admin page" description="Do
admin stuff" roles="Admin" securitytrimmingEnabled="true" />
<siteMapNode url="~/Admin/PowerUser.aspx" title="Power User Page"
description="Power user" roles="Admin, Power User"
securitytrimmingEnabled="true"/>

=-=-=-
Those items will only show up on the menu for people who are logged in as
Admin's and/or Power Users.

Also, be sure to turn on Forms authentication in web.config along with
SecurityTrimmingEnabled for the sitemap provider:
=-=-=-=-
<authentication mode="Forms"/>
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<providers>
<clear/>
<add name="XmlSiteMapProvider" description="Default SiteMap provider."
type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap"
securityTrimmingEnabled="true"/>
</providers>
</siteMap>
=-=-=-

For a more thorough article on the subject checkout those four guys from
rolla - http://aspnet.4guysfromrolla.com/articles/122805-1.aspx

--
enjoy - brians
http://www.limbertech.com
"Bazza Formez" wrote:
Hi,

I am building a new site where I want to utilise the new Menu control
feature with .Net 2.0.
I can see how this normally works, ie. by defining a SiteMapDataSource
control and use of the map.sitemap xml file which defines the menu
nodes & sub-nodes that will be used to build the menu.

My problem is this : I want the menu displayed to be dependent on the
role of the logged on user. If an Administrator logs in, I want to
display a very different menu to that which is to display when a
standard user logs in.

Is this possible ? I really need multiple versions of the web.sitemap
file .. & use the appropriate file for the role of the user. But, I
the web.sitemap is something that loads at application startup
apparently - and is shared for all users of the app in that case.

Surely this must be a common requirement (?)

Can anyone suggest anything ?

Thanks!
Bazza

Mar 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
9
by: flarkblark | last post by:
I recently had the displeasure of looking at the code required to implement the pop-up menus used in a pulldown menu system for a webpage. The sheer amount of Javascript required was amazing...
3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
32
by: Continental Translations | last post by:
Can anybody help me? I am trying to create two drop down menus, where the results of the second one vary depending on what was selected in the first one. I am using MS Script Editor in MS Front...
3
by: rhamlin | last post by:
I'm fairly new to creating complex sql statements and need a little help. In plain english I want to do this: Select menu rows where the row's userGroupIDs equal the user's userGroupIDs. ...
19
by: Zytan | last post by:
I want multiple instances of the same .exe to run and share the same data. I know they all can access the same file at the same time, no problem, but I'd like to have this data in RAM, which they...
1
by: pedalpete | last post by:
Hey Gang, More difficult to describe this than see it, so here's a link which shows the issue I'm having http://zifimusic.com/testing/broken-hovers.html I've been looking at this for quite a...
0
by: JosAH | last post by:
A Simple Text-Based Menu System Read this this post; there are numerous posts like that: a newbie struggling with some sort of menu implementation. They want nested menus of course and an option...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.