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);
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
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.
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
Thanks slace, that's exactly what I was looking for!
is working on a reply...