470,811 Members | 1,144 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,811 developers. It's quick & easy.

Menu/SiteMap question - visibility

Let's say I have an ASP.Net menu, with a datasourceID of a siteMapPath,
which of course is based on a web.sitemap file

Based on the person logged into the page, I have code in files in the
App_Code folder which gets their job code, by which I need to let some
people see some things (some root nodes and sometimes it's a sub node) and
other people not see things.
However, I don't know how to refer to the Menu Items in code
As I understand it, if I built a menu item manually, it would be something
like this:

<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Website Home"
Value="Home"></asp:MenuItem>

But, in the web.SiteMap file, it is something like this:
<siteMapNode title="Website Home" url="~/default.aspx" description="Website
Home"></siteMapNode>

but nothing for the 'value'.
So, if I hard coded the items, The 'Text' property in the MenuItem control,
here, matches up with the title attribute in the siteMapNode.
Therefore, I could refer to them by their value (in this case, "Home"), but
if it's based on the web.SiteMap file, there's no 'value' attribute.

Any ideas here?
Jun 27 '08 #1
1 1468
There is no value, so if you want to write your own security mechanism, it
will be much more complex.

Or

You can use security trimmings on the provider and set security in a
web.config file to set either users or roles. You can also set the roles in
the site map file, if you would prefer, but any place with restricted roles
requires a roles="*" on parent nodes without security.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"Seth Williams" <sm@here.comwrote in message
news:eZ*************@TK2MSFTNGP02.phx.gbl...
Let's say I have an ASP.Net menu, with a datasourceID of a siteMapPath,
which of course is based on a web.sitemap file

Based on the person logged into the page, I have code in files in the
App_Code folder which gets their job code, by which I need to let some
people see some things (some root nodes and sometimes it's a sub node) and
other people not see things.
However, I don't know how to refer to the Menu Items in code
As I understand it, if I built a menu item manually, it would be something
like this:

<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Website Home"
Value="Home"></asp:MenuItem>

But, in the web.SiteMap file, it is something like this:
<siteMapNode title="Website Home" url="~/default.aspx"
description="Website Home"></siteMapNode>

but nothing for the 'value'.
So, if I hard coded the items, The 'Text' property in the MenuItem
control, here, matches up with the title attribute in the siteMapNode.
Therefore, I could refer to them by their value (in this case, "Home"),
but if it's based on the web.SiteMap file, there's no 'value' attribute.

Any ideas here?


Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jackson Yap | last post: by
4 posts views Thread by Mark Parter | last post: by
6 posts views Thread by dpomt | last post: by
3 posts views Thread by John Dann | last post: by
1 post views Thread by Kbalz | last post: by
2 posts views Thread by mocsoft | last post: by
2 posts views Thread by Matt | last post: by
4 posts views Thread by TycoonUK | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.