Solved

automatically authorising a new user i have added to a role

Posted on 2012-03-25
4
321 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 500 total points
ID: 37788443
call Membership.ValidateUser with username and password
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

717 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