More in this section

Forums / Developing with Sitefinity / Using a custom User Profile's fields in the Registration widget

Using a custom User Profile's fields in the Registration widget

2 posts, 1 answered
  1. Dave
    Dave avatar
    76 posts
    10 Mar 2008
    13 Mar 2014
    Link to this post

    I have a custom User Profile setup, and a matching class that inherits from Telerik.Sitefinity.Security.Model.UserProfile.  I copied a lot of the code from Telerik.Sitefinity.Security.Model.SitefinityProfile but updated to use my custom Profile's fields.  In my Registration Widget template, I am setting the DataFieldName and DataItemType properties:


    <sf:TextField Id="companyName" runat="server" DataFieldName="CompanyName" DataItemType="My.Custom.UserProfile" Required="true" CssClass="sfregisterField" Title="Company Name" DisplayMode="Write" Value='<%# Eval("CompanyName")%>' />

    Unfortunately when submitting the form, I am getting the error:


    Value cannot be null.
    Parameter name: Can't create a profile instance because no dynamic type with name "My.Custom.UserProfile" was found

    The class is definitely being compiled and referenced by the Web Application.  Does anyone have any ideas, or an example of this working?

  2. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    21 Jan 2015
    14 Mar 2014
    Link to this post
    Hello Dave,

    This error could be caused by variety of reasons - either your UserProfile is not implementing all interfaces required or could e.g. you have not referenced your custom library into your Sitefinity project. I could suggest to inherit SitefinityProfile and override the necessary methods instead of copying the code as you will ensure that all required classes / interfaces have been implemented.

    i hope this helps.

    Vassil Vassilev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 1 answered