Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assigning users to a role without using ASP.NET Configuration

Posted on 2006-06-10
1
Medium Priority
?
433 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 1500 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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