User Profile custom property

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.
7/18/2011 9:55:29 AM
Gravatar
Total Posts 6

User Profile custom property

Hi,

I'm setting up my first mojoportal site, and creating some user profile settings. I need to record how the user found out about the site (i.e. Google, word of mouth, other etc). If they select other they are asked to enter details in a separate textbox (this is optional however).

Is there some combination of the settings in the config file that would make the textbox visible on registration, but not have it fail validation if there is no content? Or would this need to be done as a usercontrol for these two fields?

7/18/2011 10:22:03 AM
Gravatar
Total Posts 18439

Re: User Profile custom property

Hi,

Yes you would have to use a custom UserControl that implements ISettingControl

Note that the custom profile fields are only simple key value pairs so to do it in one control so the dropdown lists can be related you would have to store both values as a single setting, like a pipe separated string or something like that.

If you are working with the source code you can find an example that is similar under Web/Controls/CountryStateSetting.ascx which is a UserControl that implements ISettingControl and it has 2 dropdowns one for country and one for state, it returns a single value pipe separated like Country|State to capture both country and state. So you could implement something similar and plug it in as a profile property.

Hope that helps,

Joe

7/19/2011 9:14:30 AM
Gravatar
Total Posts 6

Re: User Profile custom property

I thought that was probably the case - I'll take a look at the controls you suggested. Thanks for the quick reply.

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