Custom field in the registration

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/21/2012 11:49:30 AM
Gravatar
Total Posts 1

Custom field in the registration

Hi. I added in mojoProfile.config:
<add    name="Domain"
type="System.String"
allowMarkup="false"
resourceFile="ProfileResource"
labelResourceKey="DomanIn"
lazyLoad="false"
showOnRegistration="true"
requiredForRegistration="false"
allowAnonymous="false"
visibleToAnonymous="false"
visibleToAuthenticated="true"
visibleToUser="true"
editableByUser="false"
regexValidationExpression=""
regexValidationErrorResourceKey="DomanInWarning"
maxLength="7"
cssClass="widetextbox"
onlyAvailableForRoles=""
onlyVisibleForRoles=""
includeHelpLink="true"
/>

Now it is necessary take the value of Domain in ConfirmRegistration.aspx.

But when the:
SiteUser siteUser = SiteUser.GetByConfirmationGuid(siteSettings, registrationConfirmationGuid);
string domainUser = siteUser.Domain;

writes:

Eror:"'mojoPortal.Business.SiteUser' does not contain a definition for 'Domain' and no extension method 'Domain' accepting a first argument of type 'mojoPortal.Business.SiteUser' could be found (are you missing a using directive or an assembly reference?)"

10/22/2012 11:54:47 AM
Gravatar
Total Posts 18439

Re: Custom field in the registration

You don't get strongly typed properties for custom properties added by configuration. There is a code example at the bottom of the article User Profile Configuration that shows how to get the property value.

You should not be modifying mojoPortal code in ConfirmRegistration.aspx or anywhere else, see the article Avoid Forking the Code

If you want to do something with that custom property after registration you could implement a custom User Registered Event Handler that can plugin without forking the mojoPortal code.

Hope that helps,

Joe

 

You must sign in to post in the forums. This thread is closed to new posts.