Solved

Assigning users to a role without using ASP.NET Configuration

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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 …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 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