Creating a Custom Welcome Menu for SharePoint Server 2010 – Part 3

Part 3 – Sign Out/Sign in as a Different User

A project I am working on called for a custom implementation of the SharePoint Welcome menu control. The replacement control needed to provide the following:

  • Implement the look and behaviors that the designers created.
  • Exclude some default SharePoint menu items (such as My Regional Settings).
  • Reuse some existing SharePoint menu items (such as Sign Out/Sign in as a Different User).
  • Allow for the addition of other custom menu items in the future.
  • Display thumbnail of the user’s profile picture.

I had to create a control that looked and behaved like the following:

CropperCapture2_thumb1_thumb

The designers came up with some clean, semantic markup married with some jquery, for me to start from:

This is part 3 of a three part series.

  1. Part 1 – Overview, Profile Picture, and User Name
  2. Part 2 – Edit Profile and My Site links
  3. Part 3 – Sign Out/Sign in as a Different User

Building the Sign Out Links

The Sign Out and Sign in as a Different User menu items are rendered by the PersonalActions control, in two methods (from Reflector):

The “Sign Out” link points to “_layouts/SignOut.aspx”, and “Sign in as a Different User” points to “_layouts/closeConnection.aspx”.

To leverage this, I again adjusted the ASCX markup to include some PlaceHolder and LinkButton controls:

And then here is some code-behind that re-creates the output from the PersonalActions control:

Summary

In this post, we deconstructed the PersonalActions control further to re-create the Sign Out and Sign in as a Different User menu items.

Our Final ASCX markup is:

Our Final ASCX code-behind is:

Hopefully you find this useful, and can take it further if need be. Leave comments if you have any questions.

2 comments on “Creating a Custom Welcome Menu for SharePoint Server 2010 – Part 3

Comments are closed.