?
Solved

automatically login user after registering

Posted on 2011-02-10
4
Medium Priority
?
492 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
3 Comments
 
LVL 14

Accepted Solution

by:
robasta earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

840 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