When editing his profile in SharePoint, a user can (among other things) choose a profile picture.
He clicks Choose Picture and choose a file from his hard-drive disk.
The user experience could be better, maybe we could replace this control by our own?
This is possible using the Delegate Control feature of SharePoint.
I won’t explain what is a Delegate Control because there are already plenty of articles targeting this matter, here for instance.
if you read the article I referenced above, you should have understood by now that a Delegate Control allows you to replace a Control by another but in order to do that, you need to know the ControlId and the Scope
I made myself some digging into the EditProfile.aspx (14/TEMPLATE/LAYOUTS)
You will see that the control responsible for displaying the editing profile section of the page is called ProfileEditor. Using Reflector, I looked ProfileEditor up and realized that it inherits from ProfilUI. If you look at the decompiled code of this abstract class, you will find that the “Choose Picture” Control is in fact a DelegateControl with the following ControlId : MySitePictureEditor and the following Scope : Farm.
Note: ProfilUI is located under the Microsoft.SharePoint.Portal.WebControls namespace in the Microsoft.SharePoint.Portal.dll assembly.
I created a base SharePoint Project which uses the information we have collected above to replace the OOTB MySitePictureEditor, you can download it here.
For demo purpose, I just put a nice I got you!! label.
You can use this project and implement whatever solutions you come up with:
- a Silverlight Control (webcam photo capture, …)
- an advanced picture editor allowing the user to resize, crop, …
If I have time, I’ll look myself to implement one of these solutions.
Hope it helps!