Extending UserProfile with custom controls

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.
8/25/2010 4:52:11 AM
Gravatar
Total Posts 3

Extending UserProfile with custom controls

I'm working on a site which requires an extended user profile, so I decided to build some custom controls (ascx) and add them to the UserProfile.aspx page. I have a custom database with user defined properties from which I also populate the controls.

I also changed tab names and added tabs, everything works great.

However for the time being I have used the postback caused by the 'Update' button to save my custom values using the code behind of the user controls, but that is not a sustainable solution (and incorrect as well). So I would like to bind my 'SaveValues' method to the 'Update' button that is available on the 'UserProfile.aspx' page. Can you tell me how to do that?

Thanks!

8/25/2010 7:37:03 AM
Gravatar
Total Posts 18439

Re: Extending UserProfile with custom controls

Hi,

Sorry but you are off the tracks if you are modifying mojoPortal code directly, that is forking it not extending it, and once you do that you will never be able to upgrade without losing your changes and you will soon regret going down that path when there is a new feature or a bug fix you want in a new version of mojoPortal.

You can add simple extra profile properties by configuration

http://www.mojoportal.com/userprofileconfiguration.aspx

you can also add UserControls that implement ISettingControl and you can add it to the profile page. Internally it can just return and empty string for the ISettingControl get value, but you can have your own logic for saving things, ideally in an UpdatePanel so your control doesn't post back the whole page. However that would require a separate save button inside your control or some auto save logic.

The only other solution would be to have a completely custom Profile page that you have in a separate web project of your own and use post build events to copy it up and replace the mojoportal profile page. It will still require you to maintain your forked user profile page, but at least then your code is in separate projects and you can still always pull the latest code from the repository and build your custom solution with the latest mojoPortal code. So you could still get upgrades and the latest code but you could never use the official release packages, you would always have to produce your own builds in order to include your custom code.

Hope it helps,

Joe

8/25/2010 9:02:26 AM
Gravatar
Total Posts 3

Re: Extending UserProfile with custom controls

Hi Joe, thanks for the quick reply!

I'm aware that I'm kind of forking the project (I did keep custom code separated) but I looked into the User Profile configuration but could find how to implement what I would like to have. For example I need to upload several documents and also have multiple generated lists of checkboxes based on values in reference tables. Also I would like to have those custom values in a custom database. By using a custom control I could realize that quite well, but if you say that I can do that too using standard (config) functionality I'd be more than happy.

Also my list of custom values would be so big that multiple tab pages are necessary, which also works now. Can you extend the number of tabs without having to change the UserProfile.aspx page?

9/27/2011 5:54:08 PM
Gravatar
Total Posts 1

Re: Extending UserProfile with custom controls

Joe,

How do you create a "UserControls that implement ISettingControl and you can add it to the profile page"?

I would like to add custom tabs like | order history | new order | in the UserProfile.aspx page for all users and have a online order form in the "new order" tab. I thought about using webstore but its not a product its a service that requires the user to fill out a online form.

Any quick advice would be greatly appreciated.

Armin B.

 

 

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