Post Pic

How to find out what groups an Umbraco Member belongs to

In a project I am currently working on there is a facility for Umbraco users to export Membership and Profile data. As part of the export the client also wanted to include the groups a member belongs to and here is how I achieved it, I hope it is of use to someone else.

Member m = new Member(mid);
// Loop through the member groups and add them to the field
foreach (MemberGroup mg in m.Groups.Values)
{
//- Do your stuff in here, e.g.
csv.Append(mg.Text); // Appends the Member group name
}

Related Posts

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

One Response

06.18.09

Works great. However these methods are obsolete. How about updating it with the standard asp.net membership methods?

Leave Your Response

* Name, Email, Comment are Required

Umbraco Certified Developer
FreshBooks
ElasticHosts: Flexible Servers in the Cloud
SagePay Approved Partner
Microsoft WebsiteSpark