Solved

Assigning users to a role without using ASP.NET Configuration

Posted on 2006-06-10
1
425 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now