My ProfileProvider has (among others) the following getter and setter:
[SettingsAllowAnonymous(false)]
public string description
{
get
{
var o = base.GetPropertyValue("description");
if (o == DBNull.Value)
{
return string.Empty;
}
return (string)o;
}
set
{
base.SetPropertyValue("description", value);
}
}
The custom Umbraco property alias is called "description" (in that casing). When I try to get the Profile for an Umbraco member of type "Ekspert", the decription method throws a NullReferenceException. I try to get the profile like this in my MVC controller (MemberProfile is my custom profile class):
Also, I get the same profile from this call, whether the supplied username exists in Umbraco or not, indicating that some basic setting/connection to Umbraco is missing.
Does it have something to do with my controller not inheriting from UmbracoController and thus not having an UmbracoContext?
Using UmbracoMemberProfileProvider in stand-alone ASP.NET MVC site
I'm trying to use Umbraco's Member functionality in a stand-alone ASP.NET MVC site. I've included the dlls from Umbraco 6.1.6 in the MVC project.
It works fine as long as I use the Members functionality for validating and logging in users on my MVC site.
But when I want to get and set the custom properties on my MemberType, I can't seem to get access to those.
My web.config for the MVC site looks like this:
My ProfileProvider has (among others) the following getter and setter:
The custom Umbraco property alias is called "description" (in that casing). When I try to get the Profile for an Umbraco member of type "Ekspert", the decription method throws a NullReferenceException. I try to get the profile like this in my MVC controller (MemberProfile is my custom profile class):
Also, I get the same profile from this call, whether the supplied username exists in Umbraco or not, indicating that some basic setting/connection to Umbraco is missing.
Does it have something to do with my controller not inheriting from UmbracoController and thus not having an UmbracoContext?
is working on a reply...