dotnetnuke 头像调用 头像缩放

        public static string GetProfileImage(int userId, int width, int height)
        {         
            return "~/profilepic.ashx?userid=" + userId.ToString() + "&w=" + width.ToString() + "&h=" + height.ToString();
        }

 

 

参与网站

http://www.ventrian.com/blog/getting-user-profile-image-paths-in-dotnetnuke

Luckily, this is a fairly trivial task with DotNetNuke:

protected string GetProfileImage(int userId)
{
    return Page.ResolveUrl("~/profilepic.ashx?userid=" + userId.ToString());
}

By default, it looks to be restricted to a maximum width and height of 55px. However, you can pass in parameters to control the width & height.

protected string GetProfileImage(int userId, int width, int height)
{
    return Page.ResolveUrl("~/profilepic.ashx?userid=" + userId.ToString() & "&w=" & width.ToString() & "&h=" & height.ToString());
}


http://www.ventrian.com/blog/better-profile-pictures-in-dotnetnuke
<img alt="Profile Avatar" src="/profilepic.ashx?userId=[USER:USERID]&h=64&w=64" width="64" height="64">

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。