Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

automatically authorising a new user i have added to a role

Posted on 2012-03-25
4
Medium Priority
?
334 Views
Last Modified: 2012-08-13
Hi,

I'm just getting into roles and membership.

I have the code below which is on my registration page.

The users username is their email address.

Once the user has entered their information click register I want to save their details as I have done, add them to the relevant role and then re-direct them to the main menu of the private area.

The only bit I am missing below is how to "automatically" authorise them?
//we use the email as the username and give it customer membership
                Roles.AddUserToRole(c.Email, "Registered Customer");

                //need a step here to authorise the user automatically so they have access to the private area.
                //????

                //now we need to "log" the user in and re-direct to the customer main menu
                Response.Redirect("ClientArea/CustomerMainMenu.aspx");

Open in new window

0
Comment
Question by:scm0sml
[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
4 Comments
 
LVL 7

Expert Comment

by:Lalit Chandra
ID: 37763004
0
 

Author Comment

by:scm0sml
ID: 37770128
I can't see anything in there that is doing what I'm after...

Basically after saving my new user to the database I want to authorise them.

They have been added to the role so I just need to say "right this user is now logged in"...?
0
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 2000 total points
ID: 37788443
call Membership.ValidateUser with username and password
0

Featured Post

Independent Software Vendors: 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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

604 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