1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom User Fields

Custom User Fields

2 posts, 0 answered
  1. Juan Sola
    Juan Sola avatar
    28 posts
    Registered:
    08 Jan 2007
    10 Jul
    Link to this post
    I followed the steps outlined here
    http://docs.sitefinity.com/for-developers-create-user-profiles
    as well as http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity-/adding-custom-attributes-to-users

    I added a PhoneNumber, Region, Brand, and Comment field to the default user profile. All but Comment were short text type.

    I basically copied the registration controller and registratioviewmodel code from the Feather github page and tweaked them for my purposes. For the normal fields in the SitefinityProfile class it's working fine. However calling DoesFieldExist on the profile instance with values of "PhoneNumber", "Region", "Brand" or "Comment" returns false. Attempting to set the values anyway fails with an error of type System.NotSupportedException: 'Type 'Telerik.Sitefinity.Security.Model.UserProfile' does not contain property with name 'PhoneNumber'.' I can set them manually in the admin screen so I know that they exist. I just can't seem to find a way to access them in a widget.

    Is there something else I need to do? None of the code samples indicate any other actions or code that I might need to write.

    We're running Sitefinity 10.0
  2. Adam
    Adam avatar
    23 posts
    Registered:
    05 Apr 2013
    01 Sep
    Link to this post

    Please help! We are running into the same issue with version 10 for the Profile created event in the global.asax

    var externalProviderName = eventInfo.Profile.User.ExternalProviderName;
    if (externalProviderName == "someval")
    {
    eventInfo.Profile.SetValue("someVal", "true");
    }

    And yes, "someVal" was created as a custom profile field

2 posts, 0 answered