?
Solved

automatically authorising a new user i have added to a role

Posted on 2012-03-25
4
Medium Priority
?
327 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

801 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