Solved

automatically login user after registering

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 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