I tried a lot on implementing a custom profile provider in ASP.NET MVC. I\'ve read lots and lots of tutorials, but I can\'t find where my problem is. It\'s pretty similar to
Yeah, it's because I'm using a class for my properties, ProfileCommon that inherits from ProfileBase.
public class ProfileCommon : ProfileBase
{
public virtual string Label
{
get
{
return ((string)(this.GetPropertyValue("Label")));
}
set
{
this.SetPropertyValue("Label", value);
}
}
public virtual string FirstName
{
get
{
return ((string)(this.GetPropertyValue("FirstName")));
}
set
{
this.SetPropertyValue("FirstName", value);
}
}
public virtual string LastName
{
get
{
return ((string)(this.GetPropertyValue("LastName")));
}
set
{
this.SetPropertyValue("LastName", value);
}
}
public virtual ProfileCommon GetProfile(string username)
{
return Create(username) as ProfileCommon;
}
}
You can see that I'm using this class in the Web.Config file:
[...]
And with ASP.Net MVC, if I wrote my properties in Web.Config, I cannot access them using Profile.PropertyName anymore. Maybe there's a way, but I don't find any examples.