I'm trying to create new members in umbraco 4.5, using Membership.CreateUser as Member.MakeNew is marked as obsolete. The first problem is that I don't know how to assign a member type to the member. Then I thought I only need one member type so in web.config I changed defaultMemberTypeAlias to the member type I created in the backend. But I get the error Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery. Member.MakeNew works just fine though. What should I do?
Slace, I checked the stack trace and easily figured out what was wrong, I wasn't supplying the 3rd Membership.CreateUser param, the email. I didn't do that because the user name is actually the user email. Anyway, it works now, but what do I do if I'll need to use more than one member type? And how do I set custom member properties?
create members in 4.5
Hi,
I'm trying to create new members in umbraco 4.5, using Membership.CreateUser as Member.MakeNew is marked as obsolete. The first problem is that I don't know how to assign a member type to the member. Then I thought I only need one member type so in web.config I changed defaultMemberTypeAlias to the member type I created in the backend. But I get the error Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery. Member.MakeNew works just fine though. What should I do?
Thanks!
Can you provide the full stack trace for the error?
Slace, I checked the stack trace and easily figured out what was wrong, I wasn't supplying the 3rd Membership.CreateUser param, the email. I didn't do that because the user name is actually the user email. Anyway, it works now, but what do I do if I'll need to use more than one member type? And how do I set custom member properties?
For custom member properties you can use a ProfileProvider - http://www.aaron-powell.com/umbraco-members-profiles
For multiple membership types you need to define different providers, and then you just access the one you need as you need it.
Well, I guess I'll continue to use Member.MakeNew as long as it works, it's just much easier.
Thanks!
is working on a reply...