SidC
SidC

Reputation: 3213

How to Obtain DNN User Profile Fields and Values in Custom Module?

I'm developing a custom DNN module that needs to gather sensitive information from users for a payment gateway onboarding process. We want to leverage the DNN User Profile module and create additional required fields. I've located DotnetNuke.Entities.Users.UserProfile as well as DotNetNuke.Security.Profile.ProfileProvder.GetUserProfile(UserInfo). Which namespace is our best option to read the user profile values?

Upvotes: 1

Views: 699

Answers (2)

alwaysVBNET
alwaysVBNET

Reputation: 3310

using DotNetNuke.Entities.Profile;


 UserInfo oUserInfo = UserController.GetUserById(PortalSettings.PortalId, iUserID);
 string sCustomProperty = oUserInfo.Profile.GetPropertyValue("customproperty");

Upvotes: 1

VDWWD
VDWWD

Reputation: 35554

You can read profile data like this

using DotNetNuke.Entities.Profile;

ProfilePropertyDefinition ppd = UserInfo.Profile.GetProperty("FirstName");
string FirstName = ppd.PropertyValue;

Upvotes: 4

Related Questions