Solved

asp.net 2010 Authentication lost

Posted on 2013-01-14
2
183 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
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

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

Suggested Solutions

Title # Comments Views Activity
Problem to picture file 3 67
Not showing JavaScript in the list 5 36
Ajax Panel Not Updating When Triggered By Timer 4 37
Help with C#, MVC, razor. 6 21
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

914 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

18 Experts available now in Live!

Get 1:1 Help Now