Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 14th, 2008, 02:42 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Roles and Site map etc.

I want to allow access to a page, menu item or chunk of code by whether the user is authenticated/registered. For code like this: this.User.IsInRole("Administrators") how would I do it for registered users?

And this code from the web.sitemap the same question:
<
siteMapNodetitle="$Resources: SiteMap, Admin"url="~/Admin/Default.aspx"roles="Administrators,Editors,Contributors">

One last thing: I chnaged the Sitemap by adding a node and received this message: The resource object with classname 'SiteMap' and key 'Account' was not found.

Was not found where? Is there another place I need to change something?

Thanks everyone, for some reason this stuff is eluding me,

Shawn
  #2 (permalink)  
Old December 14th, 2008, 03:58 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

1. To allow access to a page for authenticated users, test the value of User.Identity.IsAuthenticated.

2. The default sitemap provider in ASP.NET does not implement security trimming based on authentication, but only on authorization (i.e., filtering based on roles). But there are other ways to handle this scenario. One way would be to enclose part of your navigation in a LoginView control. Another would be to place all registered users in a default role.

3. As for the other part, you need to read the chapter on Globalization and Localization to understand how to work with globalization resources.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
  #3 (permalink)  
Old December 14th, 2008, 04:27 PM
Authorized User
 
Join Date: Dec 2008
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Lee Dumond View Post
1. To allow access to a page for authenticated users, test the value of User.Identity.IsAuthenticated.

2. The default sitemap provider in ASP.NET does not implement security trimming based on authentication, but only on authorization (i.e., filtering based on roles). But there are other ways to handle this scenario. One way would be to enclose part of your navigation in a LoginView control. Another would be to place all registered users in a default role.

3. As for the other part, you need to read the chapter on Globalization and Localization to understand how to work with globalization resources.
Thanks! I just figured out 2 & 3. 1 I hadn't figured out # 1 yet. Thanks a bunch.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Site Map mallikalapati ASP.NET 2.0 Basics 1 February 9th, 2008 02:56 PM
Passing more than one querystring in the site map kaushikpulpa ASP.NET 2.0 Basics 1 April 20th, 2007 08:08 AM
Site map security trimming. weisma BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 December 25th, 2006 11:57 PM
display hierarchical site map using repeaters wlin ASP.NET 2.0 Basics 1 August 31st, 2006 11:18 AM



All times are GMT -4. The time now is 06:35 AM.


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