Friday, October 16, 2009

ASP.NET Enumerate profile properties

    var propertyNames = new Dictionary<string, string>();

    var profileSection = (System.Web.Configuration.ProfileSection)ConfigurationManager.GetSection("system.web/profile");
    foreach (ProfilePropertySettings propertyDefinition in profileSection.PropertySettings)
    {
        var customProviderData = propertyDefinition.CustomProviderData;
        //...
    }