473,394 Members | 1,715 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,394 software developers and data experts.

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 1531
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
4
by: Mark Parter | last post by:
I have a master page which contains a Menu control and a SiteMapPath control, both are bound to the same web.sitemap XML file. Say I have 2 pages, Page 1 and Page 2. Now Page 2 can only be accessed...
6
by: dpomt | last post by:
I have a quite strange problem with the Menu control. I have ten languages and each language has a SiteMapDataSource and a Menu. For better performance, I am creating a hashtable (language ->...
3
by: John Dann | last post by:
Newbie question: I'm guessing that using asp:menu in an aspx 2.0 web form doesn't allow search engines to index pages via the menu tree. Please can anyone confirm this? Assuming this is correct...
1
by: Kbalz | last post by:
I'm using xml site map to trim my security on my menus.. Its working rather well, but I'm having this gripe about it.. Here's my psuedo problem.. <?xml version="1.0" encoding="utf-8" ?>...
2
by: mocsoft | last post by:
Does anyone know how to use the sitemap file to generate attractive menus other than those specified in Visual Web Developer (menu, treeview). The menu control seems to always group the menu items...
2
by: Matt | last post by:
Is there a way to make menu controls behaviours like browser menu like. (file,Edit,View etc) or any other software menu dropdown.. I could do that with inbuild (<items<asp:menu:itemand make the...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.