Solved

asp.net 2010 Authentication lost

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticallā€¦
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Siā€¦

679 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