Posted by & filed under Development, DotNetNuke.

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.

Leave a Reply

  • (will not be published)