Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Javier Barrera 34 posts 85 karma points
    Aug 18, 2010 @ 06:14
    Javier Barrera
    0

    Member.MakeNew Depreciated

    I just made the switch to Umbraco 4.5 from N2, and must say that I am super excited about this CMS. Purchasing a video subscription helped tremendously, but I still have a few questions.

    I am currently buidling a registration form that programatically creates a user. I create the user no problem using standard ASP.NET membership:

                        MembershipUser user = Membership.CreateUser(txtEmailAddress.Text,
                           txtPassword.Text,
                           txtEmailAddress.Text,
                           System.Configuration.ConfigurationManager.AppSettings["PasswordRecoveryQuestion"],
                           System.Configuration.ConfigurationManager.AppSettings["PasswordRecoveryAnswer"],
                           true,
                           out status);

    The user is saved, and I can see them in the admin section of Umbraco. However, I have added custom properties that I would like to modify.

    Now, I understand how to access those properties, change them, and save them. However the method that I'm using appears to be 'depreciated.' What is the proper method of creating a user and saving custom properties? To access the user once its created using the standard ASP.NET membership, I use:

                            Member member = Member.GetMemberFromEmail(txtEmailAddress.Text);

                            if (member != null || member.Id > 0)
                            {
                                member.LoginName = txtFirstName.Text + " " + txtLastName.Text;
                                member.getProperty("First Name").Value = txtFirstName.Text;
                                member.getProperty("Last Name").Value = txtLastName.Text;
                                member.getProperty("Company").Value = txtCompany.Text;
                                member.Save();
                            }

    The website I've created uses a registration and asks the user a few questions about themselves.

  • Aaron Powell 1708 posts 3045 karma points c-trib
    Aug 18, 2010 @ 10:44
    Aaron Powell
    0

    I recommend using ASP.NET ProfileProvider for this: http://www.aaron-powell.com/umbraco-members-profiles

    The reason it's marked as deprecated is we want people to go via the standard ASP.NET methods rather than the custom API, it allows for me flexibility in your member store and more standard ASP.NET operations

  • Javier Barrera 34 posts 85 karma points
    Aug 19, 2010 @ 02:41
    Javier Barrera
    0

    Thanks slace, that's exactly what I was looking for!

Please Sign in or register to post replies

Write your reply to:

Draft