Create Member Groups/Types & Properties Programatically
I have the need to create a specific Member Group/Type programatically and then add specific properties to it, this is for a package I'm creating and will be done via a usercontrol.
Anyone know of a package that does this? So I can check out how they went about it, or if you have done it a snippet example of code would be really helpful :)
For anyone interested, heres how I did - This basically creates a membertype and group with an alias of 'ForumUser', adds a tab called 'Content' to the member type and adds three properties to the Member type (1 x Textstring, 2 x Numeric)
Unfortunatly, I got stuck on the first line of code : CreateMemberType is not recognised ! I'm using Umbraco v6. I found out I could replace that line with :
Create Member Groups/Types & Properties Programatically
I have the need to create a specific Member Group/Type programatically and then add specific properties to it, this is for a package I'm creating and will be done via a usercontrol.
Anyone know of a package that does this? So I can check out how they went about it, or if you have done it a snippet example of code would be really helpful :)
anyone :S Guess I'll be digging in Umbraco source
Bump :S
For anyone interested, heres how I did - This basically creates a membertype and group with an alias of 'ForumUser', adds a tab called 'Content' to the member type and adds three properties to the Member type (1 x Textstring, 2 x Numeric)
Hope it helps someone :)
Hi,
This is just what I was looking for.
Unfortunatly, I got stuck on the first line of code : CreateMemberType is not recognised ! I'm using Umbraco v6.
I found out I could replace that line with :
MemberType mt = MemberType.MakeNew(User.GetUser(0), memberTypeAlias);
I then got stuck on another unrecognised method GetTabByCaption :
But it could be replaced with :
prop.TabId= iTabID;
Where iTabID is instantiated when creating the new tab like so:
// Now create the tab
int iTabID = mt.AddVirtualTab(memberTabName);
Thanks Lee, it did help some1
Hope it helps some others 2 ...
Guys,
I had trouble too. (umbraco 6.2.1) But I finally got it like this:
Creating the membertype
Creating Properties in tabs + saving it
The following functions couldnt be found (dont know whats going on here)
Hi take a look at http://www.charlesafford.com/blog-folder/umbraco-members-and-aspnet-membership-provider-1-1/
This should point you in the right direction :)
Anyone know the equivalent of the MemberType in Umbraco 7? Currently using Umbraco.Core.Models, but receive an error getting to the method MakeNew
is working on a reply...