As far as I'm aware, the only methods of the UmbracoProfileProvider that are implemented are the "GetPropertyValues" and "SetPropertyValues". All the other methods throw a NotSupportedException.
In this case, you'll need to roll your own ProfileProvider (that inherits from the UmbracoProfileProvider).
I've been doing some work with the MembershipProviders recently, although I haven't used the ProfileProvider yet - I ended up going direct to the Umbraco members API (even though most of them are marked as obsolete). Like you say, its often the best solution you can come up with at the time! :-)
//Umbraco says this method is obsolete, but it is needed to retrieve the profile properties from a non-logged in user.. var m = Member.GetMemberFromLoginName(username);
I have a MemberData class that I inherit from for each member type, marking properties with [MemberProperty(Alias="property alias")]. In my MemberPropertyManager.GetProfileProperties I use reflection to get the property aliases and retrieve them the using the Member API.
Retrieve a member's profile by username
Hi,
Is there a way to retrieve a member's profile by username?
Normally a MembershipProvider has a method like this:
But I see in the Umbraco sourcecode that this method is not supported:
Is there a specific reason why this method is not supported?
Is there an alternative?
Thanks.
Hi Thomas,
As far as I'm aware, the only methods of the UmbracoProfileProvider that are implemented are the "GetPropertyValues" and "SetPropertyValues". All the other methods throw a NotSupportedException.
In this case, you'll need to roll your own ProfileProvider (that inherits from the UmbracoProfileProvider).
Also, there is a blog post about Member Profiles here: http://aaron-powell.com/umbraco-members-profiles
Cheers, Lee,
Thanks Lee for taking the time to answer my questions.
I didn't think about inheriting from the UmbracoProfileProvider class, that would have been a cleaner solution than what I came up with.
Hi Thomas, you're welcome.
I've been doing some work with the MembershipProviders recently, although I haven't used the ProfileProvider yet - I ended up going direct to the Umbraco members API (even though most of them are marked as obsolete). Like you say, its often the best solution you can come up with at the time! :-)
Cheers, Lee.
Indeed, I did the same.
Straight from my project:
I have a MemberData class that I inherit from for each member type, marking properties with [MemberProperty(Alias="property alias")].
In my MemberPropertyManager.GetProfileProperties I use reflection to get the property aliases and retrieve them the using the Member API.
I'll just leave this here for future googlers.
is working on a reply...