CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/31/2007 8:23:46 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 60 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
schoesler
Asp.Net User
Hide sitemap nodes10/31/2007 8:23:46 AM

0/0

Hi

How do I hide sitemap nodes based on "roles" recieved in a server variable?

My site is protected by GetAccess/Entrust. The authentication is therefore done elsewhere. If the user is authenticated the ServerVariables("http_role") will include the users roles. Example: ServerVariables("http_role") = "wba, wor.wba, wpd.wba" which means the user can place orders and read product information (see nodes 2-9 in the sitemap below), but not see prices or news:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="default.aspx" title="1 Home" description="">
      <siteMapNode url="" title="2 Bitstream Access" description="" role="wba">
        <siteMapNode url="" title="3 Orders" description="" role="wor.wba">
          <siteMapNode url="" title="4 Ordreafgivelse" description="" role="wor.wba" />
          <siteMapNode url="" title="5 Track &amp; Trace" description="" role="wor.wba" />
        </siteMapNode>
        <siteMapNode url="" title="6 Products" description="" role="wpd.wba">
          <siteMapNode url="" title="7 Productinfo" description="" role="wpd.wba" />
          <siteMapNode url="" title="8 Userguides" description="" role="wpd.wba" />
          <siteMapNode url="" title="9 Seminars" description="" role="wpd.wba" />
        </siteMapNode>
        <siteMapNode url="" title="10 Prices" description="" role="wpr.wba">
          <siteMapNode url="" title="11 Pricelists" description="" role="wpr.wba" />
          <siteMapNode url="" title="12 Price changes" description="" role="wpr.wba" />
        </siteMapNode>
        <siteMapNode url="" title="13 News" description="" role="wny.wba">
          <siteMapNode url="" title="14 Newsletter" description="" role="wny.wba" />
        </siteMapNode>
      </siteMapNode>
    </siteMapNode>
</siteMap>

The nodes 10 - 14 have to be hidden/disabled, but not deleted from the sitemap. How can I do that?

Thanks
Schoesler

master19
Asp.Net User
Re: Hide sitemap nodes10/31/2007 11:13:11 AM

0/0

Hi,

i've a similar problem but without roles involved. I'm implmeneting a website where you can configure some stuff. The complete configuration steps reside in a sitemap as a Menu on the left hand side. Depending on the configuration you made some sitemapnodes should be disabled, for instance if you configure something and because of your configuration the next step makes no sense. But how to do that. I havent find a way to do that with sidemapnodes.

thanks for you support.

 

Amanda Wang - M
Asp.Net User
Re: Hide sitemap nodes11/2/2007 3:01:20 AM

1/1

Hi Schoesler,

Base on your description, you want to hid the sitemap nodes base on the role, right/

From the code that you provioded, we can see you set the roles for the each sitemap node, if you want to implement to hide the sitempanode base on the role, you need to set the securityTrimmingEnabled is true in the web.config file's sitemap section.

For example: <siteMap defaultProvider="secureProvider">
        <
providers>
          <
add name="secureProvider" type="System.Web.XmlSiteMapProvider"
              
siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
        </
providers>

The more you can read this article :    http://blogs.msdn.com/dannychen/archive/2006/03/16/553005.aspx

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Essential ASP .NET 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2007
Beginning ASP.NET 2.0 in C# 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1148, Published: 2006
Grid computing in life science: First International Workshop on Life Science Grid, LSGRID 2004, Kanazawa, Japan, May 31 – June 1, 2004: revised selected and invited papers: First International Workshop on Life Science Grid, LSGRID 2004, Kanazawa, Japan, May 31 - June 1, 2004 ; Revised Selected and Invited Papers Authors: Akihiko Konagaya, Kenji Satou, Pages: 188, Published: 2005
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008

Web:
How to hide some map nodes from menu site map controls. the default Site map provider(xml file) only support show/ hide nodes depend on role setting. If you want to do it at ...
hide Sitemap Menu nodes - ASP.NET Forums Items to remove the node that you donot want to display on the page, this methos only hide the node on the page, but cannot change your ...
sitemap hide child nodes - RE: Need Help Dec 8, 2006 ... sitemap hide child nodes. > I am very new to t=his and am having a lot of trouble. That's not unusual when learning something new. ...
Walkthrough: Filtering Site-Map Nodes Based on Security Roles ... trimming to hide the navigational links to those restricted files, ... The roles attribute is only set on two nodes in the site map: Products and ...
Hide sitemap node - Directorforum Hide sitemap node microsoft.public.expression.webdesigner.
Treeview hide sitemap node... - ng.asp-net-forum ... Treeview hide sitemap node..., > ROOT > NEWSGROUP > Asp.Net Forum > general_asp. net.master_pages_themes_and_navigation_controls, Date: 9/25/2007 2:45:36 PM, ...
Hide Child Node in Web.Sitemap not using roles, possible? - ng.asp ... If you want to hide particular node and keep the rest of menuitems on the page, remove the node from sitemap file. ...
Treeview hide sitemap node... - ASP.NET Forums You can the remove method of the treeview to remove the node that you donot want to display, adn the will not change the sitemap file. ...
How to: Filter the Nodes Retrieved by SiteMapDataSource Web Server ... To hide the starting node. In the .aspx page that is three levels deep in your site map, locate the SiteMapDataSource control, which might look like ...
patterns & practices Web Client Software Factory - Discussions Sep 2, 2008 ... An easy way to hide a node is in the item data binding event of menu or tree. The site map is always complete. ...




Search This Site:










masterpage and headers?

usinng a second menu control to display childitems permanently

li a:active problem

callbackresult not working with masterpage

master page error.

how to use function from a master page?

treeview control cache

adding dynamic images on master page

treeview selectednodechanged event not firing for leaf nodes

stuck stuck stuck

accessing a contentpage control from a masterpage

writing an event for a control on masterpage

problem with postbackurl function from master page

tree view postback

submission page completion control

style works great when i don't use masterpage

css not working properly in release version for firefox

border not showing up outside of master page

seo question about masterpages

menu control - its impossible to select the leaf nodes

reference asp.net page from a master page

using sitemappath

blank target link

possible bug using masterpage, posturlback and controller page?

updateprogress in master page

merging urlmappings, navigation and multiview controls.

accessing properties of user control placed on master page

programatically referencing a control in a master page

controls inside contentplaceholder have id's modified

how can i apply custom images to my sitemap

  Privacy | Contact Us
All Times Are GMT