Return User Profile Picture relative Url

Namespace: DotNetNuke.Entities.Users
Assembly: DotNetNuke (in DotNetNuke.dll)

Syntax

C#
public string GetUserProfilePictureUrl(
	int userId,
	int width,
	int height
)
Visual Basic
Public Function GetUserProfilePictureUrl ( 
	userId As Integer,
	width As Integer,
	height As Integer
) As String

Parameters

userId
Type: System..::..Int32
User Id
width
Type: System..::..Int32
Width in pixel
height
Type: System..::..Int32
Height in pixel

Return Value

Relative url, e.g. /DnnImageHandler.ashx?userid=1&h=32&w=32 considering child portal

Implements

IUserController..::..GetUserProfilePictureUrl(Int32, Int32, Int32)

Remarks

Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> code behind - avatar.ImageUrl = UserController.Instance.GetUserProfilePictureUrl(userInfo.UserID, 32, 32)

See Also