Solved

automatically login user after registering

Posted on 2011-02-10
4
481 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

13 Experts available now in Live!

Get 1:1 Help Now