在皮肤中获取DNN配置文件属性

时间:2017-05-05 16:07:30

标签: properties themes dotnetnuke profile skin

我可以使用类似这样的用户的电子邮件

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

但是如何在皮肤中显示自定义创建的配置文件属性?

我能找到的最接近的东西是这样的:

UserProfile.GetPropertyValue("Company");

但是我收到了这个错误: 非静态字段,方法或属性'DotNetNuke.Entities.Users.UserProfile.GetPropertyValue(string)'

需要对象引用

1 个答案:

答案 0 :(得分:3)

你仍然需要从当前用户开始,所以它会是这样的:

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