Help us improve the documentation area
We'd love to make the documentation for Umbraco even better, but we need your help on where we should focus the most. So please help us help you by spending a few minutes taking this short survey.Take the Survey (and this box will also go away)
MembershipHelper is a helper class for accessing member data in the form of
MembershipHelper has a variety of helper methods that are useful when working in your views, controllers and webforms classes.
Note: For a more detailed list, visit the API documentation
How to reference MembershipHelper?
When working in templating, this helper will automatically be there for you to use as
@Members which means you conveniently in your templates easily can access member data:
If you need a
MembershipHelper in a custom class, service, view, etc... you can easily create one using this syntax:
var memberShipHelper = new Umbraco.Web.Security.MembershipHelper(Umbraco.Web.UmbracoContext.Current);
ProfileModel and IPublishedContent
When looking up Members, member data is returned as
IPublishedContent, which is the same format used for Content and Media, so referencing member properties should
be the exact same api as with those.
When looking at the currently logged in Member, you will get a
ProfileModel back, which contains the same data, by with additional methods and properties available
which are specific to members.
Looks for a member with a given email, if found, returns a member profile as
Looks for a member with a given node ID, if found, returns a member profile as
Looks for a member with a given provider key, if found, returns a member profile as
IPublishedContent. Provider key is the key that
the membership provider allocates for the member as its primary key.
Umbraco's default membership provider assigns a guid, alternative providers such as active directive likely uses another format.
Looks for a member with a given username, if found, returns a member profile as
Gets the current members login status as a
Gets the current member profile as a
Returns a boolean to state whether there is a member currently logged in.
.Login(string username, string password)
Attempts to log in a member with the given username and password
Determines if a member is authorized, based on memberType, associated roles, and member ID.
Detects if the default Umbraco membership provider is in use.
Registers a new member
Updates a current member profile