62,046
社区成员
发帖
与我相关
我的任务
分享
GetImageUrl("logo.jpg")
,而在这个函数内部,还是要先把它恢复成 ~/Content/themes/user/pc/images/{0} 然后再来计算输出的路径。
/// <summary>
/// 会员中心主题
/// </summary>
public static string UserTheme
{
get
{
if (Common.Environment.IsMobile())
{
return "~/Content/themes/user/mobile/";
}
else
{
return "~/Content/themes/user/pc/";
}
}
}
然后调用这样写
<img src="@Url.Content(Sp.Variables.Site.UserTheme)images/logo.jpg" height="110" />