Using a custom User Profile's fields in the Registration

Posted by Community Admin on 04-Aug-2018 14:28

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

All Replies

Posted by Community Admin on 13-Mar-2014 00:00

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?

Posted by Community Admin on 14-Mar-2014 00:00

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.

Regards,
Vassil Vassilev
Telerik

 
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
 

This thread is closed