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

Thank you for reading this post, don't forget to subscribe!

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);