Using the DotNetNuke Profile Photo in a Custom Module

no_avatar dnnprofilephoto

 private string GetUserPhotoUrl(UserInfo user)
        if (user.Profile.Photo == null || user.Profile.Photo == "-1")
            return user.Profile.PhotoURL;
            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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.