Q:

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?

A:

You can read profile data like this
using DotNetNuke.Entities.Profile;

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

