I'm currently working on a website that need to load data from a member.
When I retrieve the member data trough this method I get my custom properties.
public class DashboardController : SurfaceRenderMvcController
{
[DonutOutputCache(CacheProfile = "OneDay")]
public ActionResult Dashboard()
{
var model = ModelLogic.CreateMasterModel() as MasterModel<Dashboard>;
model.Content.Member = Members.GetCurrentMember() as Vendor;
return CurrentTemplate(model);
}
}
The problem is that I can load my custom properties like a phone number field but I can't access the default properties like Email and Name this way. That data is available trough the Members.GetCurrentMemberProfileModel (). But than my phone number field is not available.
Get member properties in Umbraco 7
I'm currently working on a website that need to load data from a member.
When I retrieve the member data trough this method I get my custom properties.
The problem is that I can load my custom properties like a phone number field but I can't access the default properties like Email and Name this way. That data is available trough the Members.GetCurrentMemberProfileModel (). But than my phone number field is not available.
What is the corect way of doing this?
The code i'm using is from: https://live4coding.wordpress.com/2014/08/01/using-role-based-authentication-in-umbraco/
I'm using the ZBU Models Builder (my vendor is a generated model based on my member type - vendor)
Hi Runnice Fusion,
You can create a partial class with the name "Vendor" in the same folder where you generate your content models.
On this class you can set this property
For some reason Zbu doesn't generate a property for the e-mail.
Dave
Hi Dave,
Thanks for your reply. The solution you've provided worked.
is working on a reply...