Solved

asp.net 2010 Authentication lost

Posted on 2013-01-14
2
188 Views
Last Modified: 2013-01-17
Hello Experts, I am trying to add authentication to a website, by starting with the existing default site with authentication.  I can log in and all.  However, I would like it to redirect to a landing page based upon role.

I have gone to the login page, and added the following event:

LoggedIn

In the handler, I have added the following intense code:

 if(User.IsInRole("LostUser"))
            {
                //User.Identity
                String Tom="Bock Bock Bock";
            }

As you can guess, the string Tom is never assigned the goofy phrase.  Can someone tell me what I am missing or how I can get the users role?

Thank you in advance:

Fox
0
Comment
Question by:the_b1ackfox
[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
2 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38779634
The User.IsInRole doesn't work by default.
You need to setup Roles Provider in web.config and create roles and assign it to the user.

Check this ASP.NET Roles tutorial.
0
 
LVL 9

Author Comment

by:the_b1ackfox
ID: 38786190
You led me to such a good reference!  A's across the board!
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 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