Solved

automatically login user after registering

Posted on 2011-02-10
4
483 Views
Last Modified: 2012-05-11
when a user registers using the standard asp.net membership register functionality, i need to log them in automatically and take them to their profile page to update more details

Can you explain how I would do this please and provide code examples of tutorials
thanks
0
Comment
Question by:websss
4 Comments
 
LVL 14

Accepted Solution

by:
robasta earned 500 total points
ID: 34868678
login the user with the details they supplied on the registration page e.g.

public sub Register(string username, string password, email){

 MembershipCreateStatus createStatus = MembershipService.CreateUser(model.UserName, model.Password, model.Email);
                if (createStatus == MembershipCreateStatus.Success)
                {
                   FormsAuthentication.Authenticate(username, password);
                    Response.Redirect("profilepage.aspx");
                }else{//show registration errors}
}
0
 

Author Comment

by:websss
ID: 35079050
Thanks
should this work on its own?

  FormsAuthentication.Authenticate("myusername", "mypassword");
  Response.Redirect("profilepage.aspx");
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 35906813
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Achieve json result 2 65
SQL best practice question 3 36
Authentication of Web Services 3 49
Error on Add method 1 38
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,…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 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

24 Experts available now in Live!

Get 1:1 Help Now