Add Profile Property tagged posts

How to Create Profile Property through Coding in DNN

Category: DOTNETNUKE Comments: No comments

//Here ‘Level’ is the name of profile property

if (DotNetNuke.Entities.Profile.ProfileController.GetPropertyDefinitionByName(this.PortalId, “Level”) == null)
{
DotNetNuke.Entities.Profile.ProfileController.AddPropertyDefinition(
new DotNetNuke.Entities.Profile.ProfilePropertyDefinition(this.PortalId)
{
PropertyName = “Level”,
DataType = 10,
PropertyCategory=”Level”,
Length=100,
Visible=true
});
}

//Here txtLevel is the Textbox Control for assigning of this textbox value to Profile Property ‘Level’
oUser.Profile.SetProfileProperty(“Level”, txtLevel.Text);

Read More