To Get Properties:
Dim
oUserController
As
New
DotNetNuke.Entities.Users.UserController
Dim
oUserInfo
As
UserInfo = UserController.GetCurrentUserInfo
Dim
oUserProfile
As
UserProfile = oUserInfo.Profile
Dim
properties
As
ProfilePropertyDefinitionCollection = oUserProfile.ProfileProperties
For
Each
profProperty
As
ProfilePropertyDefinition
In
properties
Select
Case
profProperty.PropertyName.ToLower
Case
"telephone"
txtTelephone.Text = profProperty.PropertyValue
Case
"cell"
txtMobile.Text = profProperty.PropertyValue
Case
"postalcode"
txtPostalcode.Text = profProperty.PropertyValue
Case
"city"
txtCity.Text = profProperty.PropertyValue
Case
"street"
txtAddress.Text = profProperty.PropertyValue
End
Select
Next
To Set Properties:
Dim
oUserController
As
New
DotNetNuke.Entities.Users.UserController
Dim
oUserInfo
As
UserInfo = UserController.GetCurrentUserInfo
Dim
oUserProfile
As
UserProfile = oUserInfo.Profile
Dim
properties
As
ProfilePropertyDefinitionCollection = oUserProfile.ProfileProperties
For
Each
profProperty
As
ProfilePropertyDefinition
In
properties
Select
Case
profProperty.PropertyName.ToLower
Case
"telephone"
profProperty.PropertyValue = txtTelephone.Text
Case
"cell"
profProperty.PropertyValue = txtMobile.Text
Case
"postalcode"
profProperty.PropertyValue = txtPostalcode.Text
Case
"city"
profProperty.PropertyValue = txtCity.Text
Case
"street"
profProperty.PropertyValue = txtAddress.Text
End
Select
Next
DotNetNuke.Entities.Profile.ProfileController.UpdateUserProfile(oUserInfo, properties)