Solved

asp.net 2010 Authentication lost

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

21 Experts available now in Live!

Get 1:1 Help Now