Solved

Assigning users to a role without using ASP.NET Configuration

Posted on 2006-06-10
1
429 Views
Last Modified: 2012-05-05
I want to assign users to a role when they register on my site
automatically so that I can specify what they do and dont
see on the menu that uses the web.sitemap file. Can I do this so that
I don't have to do it manually with the ASP.NET configuration tool ?
If not, what is another way I can do this while using a sitemapdatasource
with the web.sitemap file.
(Anonymous users and registered users must see different menus)
0
Comment
Question by:gusdogs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
deanvanrooyen earned 500 total points
ID: 16880064
proper way http://msdn2.microsoft.com/en-us/library/ms178428.aspx

one other way - on page loads check if the user is logged in eg forms authentication and display correct sitemap
setup multiple sitemaps:
http://msdn2.microsoft.com/en-us/library/ms178426.aspx

then check if the user is authenticated on page load

if (HttpContext.Current.User.Identity.IsAuthenticated)
{
        //check if it is forms auth
         if (HttpContext.Current.User.Identity is FormsIdentity)
         {
                 // set the relevant SiteMapProvider property to Company1SiteMap as the user is logged in
         }
        else
        {
                 // set the relevant SiteMapProvider property to Company2SiteMap.
        }
}
else
{
        //set the relevant SiteMapProvider property to Company2SiteMap.
}

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Build a string of emails from a gridview 2 31
Set the FileVersion of a website dll 1 60
Using sample Autorize.net c# simple example 1 57
Adding Rows to Grid 4 34
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question