Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2008, 02:41 AM
Authorized User
 
Join Date: Nov 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Roles and SiteMap Problem

I'm following along with the code in the book ASP.NET 2.0 Website Programming. Chapter 4 sets up Membership and User Profiling. After setting up the web.config to include roleManager and siteMap, and adding a node in the web.sitemap file with the roles attribute, I still am able to see the node in the Menu on the homepage when I'm not logged in. I thought that this shouldn't be the case.

Does anybody have any idea of why this could be happening or common problems that arise when setting up roles to work with sitemaps?
 
Old November 18th, 2008, 08:58 AM
Registered User
 
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You probably need to add the Admin folder, also adding the default.aspx page and the web.config (includes the following...)

<location path="Default.aspx">
 <system.web>
  <authorization>
   <allow roles="Administrators" />
   <deny users="*" />
  </authorization>
 </system.web>
</location>)

If you cant see this look at the link on the web.sitemap Admin link

 
Old November 18th, 2008, 01:19 PM
Authorized User
 
Join Date: Nov 2008
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Adding the Admin folder to the web.config as follows did it:

Code:
<location path="Admin">
    <system.web>
      <authorization>
        <allow roles="Administrators" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
Thanks steak!!
 
Old November 18th, 2008, 02:10 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Actually in the book, as I recall, the <location> element is added to a separate web.config in the Admin folder.

It works either way, so it's really a matter of preference. I actually prefer to keep roles permissions in the main web.config like you did, as they're easier to maintain that way. Just wanted to mention this in case you refer to the download code and don't see it there.

Visit my blog at http://leedumond.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Web.sitemap problem Dmitriy ASP.NET 3.5 Basics 0 October 14th, 2008 03:04 PM
Problem with Web.sitemap? Dmitriy ASP.NET 3.5 Professionals 0 October 14th, 2008 07:14 AM
cannot hide page in sitemap using roles hertendreef ASP.NET 2.0 Professional 2 August 21st, 2007 12:56 PM
problem with sitemap and role hertendreef ASP.NET 2.0 Basics 6 June 21st, 2007 05:22 PM
dynamic sitemap problem yiyo ASP.NET 2.0 Professional 0 May 2nd, 2007 04:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.