Using a custom User Profile's fields in the Registration widget
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?
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