Displaying User Profile Information on page

Remember to include the SPSWC Registration tag

<%@ Register Tagprefix=”SPSWC” Namespace=”Microsoft.SharePoint.Portal.WebControls” Assembly=”Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

 

User Name

The first line below is needed to load and make the profile properties available.

<SPSWC:ProfilePropertyLoader runat=”server”/>

<SPSWC:ProfilePropertyValue PropertyName=”FirstName” ApplyFormatting=”False” runat=”server” ShowPrivate=”True” PrefixBrIfNotEmpty=”False”/>&nbsp;

<SPSWC:ProfilePropertyValue PropertyName=”LastName” ApplyFormatting=”False” runat=”server” ShowPrivate=”True” PrefixBrIfNotEmpty=”False”/>

Email

<SPSWC:ProfilePropertyLoader runat=”server”/><SPSWC:ProfilePropertyValue cssClass=”loggedin” PropertyName=”WorkEmail” ApplyFormatting=”False” runat=”server” ShowPrivate=”True” PrefixBrIfNotEmpty=”False”/>

Image

<SPSWC:ProfilePropertyImage PropertyName=”PictureUrl” style=”float: left; height: 20px; width:20px;” ShowPlaceholder=”true” id=”PictureUrlImage” runat=”server”/>

NOTE: Those tags will only show the current user information.(Not Login user)

Advertisements

2 thoughts on “Displaying User Profile Information on page

  1. i am showing the Logged in User Information as shown in picture. but issue is that image is notgetting fetched for first time. If i go to the ‘My Profile’ and return back then and only then image get displayed. How to solve this issue. I am getting User Information using Javascript. And also how to get Department for the logged in User.
    i used following control to show image

    i am doing this on Office 365 site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s