Home > Development, DotNetNuke > Using the DotNetNuke Profile Photo in a Custom Module

Using the DotNetNuke Profile Photo in a Custom Module

March 12th, 2011

no_avatar dnnprofilephoto

 private string GetUserPhotoUrl(UserInfo user)
 {
        if (user.Profile.Photo == null || user.Profile.Photo == "-1")
            return user.Profile.PhotoURL;
        else
            return VirtualPathUtility.ToAbsolute("~/LinkClick.aspx") + "?fileticket=" + user.Profile.Photo;
 }

An anonymous user or a user without a profile photo will always get the default ‘no_avatar.gif’ image.

Development, DotNetNuke

  1. No comments yet.
  1. No trackbacks yet.