ISettingControl in ProfileView.aspx

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/19/2011 2:58:40 PM
Gravatar
Total Posts 2247

ISettingControl in ProfileView.aspx

Hi Joe,

I am building an Intranet and need to show a user's supervisor in their profile. The supervisors all belong to a single role named Managers. I created an ISettingControl which looks up the members of the Managers role and adds them to a drop down list for selection. The supervisors' UserID is stored when the profile is saved.

Users should not be able to change their Supervisor so I set the "editableByUser" option to false in the profile config. This resulted in the UserID for the selected supervisor showing up on the UserProfile.aspx page. To get around this, I modified the ISettingControl to disable the dropdown if the logged-in user is not a member of the Administrators or Role Admins role. This results in the drop down being displayed in a disabled state. All of this is working great.

The problem now is that the UserID for the selected Supervisor is being displayed on the ProfileView page. I realize that the ISettingControl is probably not being called for the ProfileView page (nor the UserProfile when the profile definition has editableByUser="false" set). So, how do I go about displaying the Supervisor's name and not their UserID on the ProfileView page?

Thanks,
Joe D.

10/19/2011 3:20:42 PM
Gravatar
Total Posts 18439

Re: ISettingControl in ProfileView.aspx

Hi Joe,

You are right that on ProfileView.aspx is just showing the raw value in a label and not loading ISettingControl.

I've added an item in the project tracker to figure out a solution for this. 

Best,

Joe

11/18/2013 12:04:55 PM
Gravatar
Total Posts 18439

Re: ISettingControl in ProfileView.aspx

fyi, I implemented a solution for this recently (this change is included in version 2.4.0.0) so that profileView page will load the same ISettingControl but will check if it implements IReadOnlySettingControl and if it does then it will load add the control to the page and call SetReadOnlyValue so that you can render differently for read only within the same control.

So your .ascx.cs you would just put a comma and add IReadOnlySettingControl and implement the SetReadOnlyValue method defined in the interface.

Not sure why it took so long to get to this, should have done it sooner.

Best,

Joe

11/18/2013 12:39:22 PM
Gravatar
Total Posts 2247

Re: ISettingControl in ProfileView.aspx

Thanks, Joe.

Much appreciated. I'm not sure how I got around this back then, maybe I didn't and just left it as it was. I'll have to go back and look.

Thanks,
Joe D.

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