Search code examples
propertiesthemesdotnetnukeprofileskin

Get DNN Profile Properties In Skin


I can get thing like the user's email with something like this

<% =UserController.GetCurrentUserInfo().Email %>

But how can I get a custom created profile property to display in the skin?

The closest thing I could find was something like this:

UserProfile.GetPropertyValue("Company");

But I get this error: An object reference is required for the non-static field, method, or property 'DotNetNuke.Entities.Users.UserProfile.GetPropertyValue(string)'


Solution

  • You still need to start from the current user, so it would be something like this:

    UserController.GetCurrentUserInfo().Profile.GetPropertyValue("Company")