Solved

asp.net 2010 Authentication lost

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

806 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