I have a scenario where I need to be able to create members of several different member types. I am currently using the CreateUserWizard control and am attempting to change the member type in the CreatedUser event, but I am having no luck. The following code snippet does nothing (no update, no read-only error for ContentType).
Member m = Member.GetMemberFromLoginName(CreateUserWizard1.UserName); m.ContentType = ContentType.GetByAlias("MemberTypeAlias"); m.Save();
I know I can scrap the CreateUserWizard and roll my own control using Member.MakeNew, but I was just wondering if it were possible to get this done using the wizard.
I added another membership provider entry (copied UmbracoMemberShipProvider) in the web.config file and only changed the defaultMemberTypeAlias. Then, I was able to change the CreateUserWizard's MembershipProvider property to my new provider in the CreatingUser event.
Change member type programatically
I have a scenario where I need to be able to create members of several different member types. I am currently using the CreateUserWizard control and am attempting to change the member type in the CreatedUser event, but I am having no luck. The following code snippet does nothing (no update, no read-only error for ContentType).
I know I can scrap the CreateUserWizard and roll my own control using Member.MakeNew, but I was just wondering if it were possible to get this done using the wizard.
I found one workaround.
I added another membership provider entry (copied UmbracoMemberShipProvider) in the web.config file and only changed the defaultMemberTypeAlias. Then, I was able to change the CreateUserWizard's MembershipProvider property to my new provider in the CreatingUser event.
Does anyone have a better solution?
is working on a reply...