📄 logo.cs
字号:
namespace ASPNET.StarterKit.Communities {
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
//*********************************************************************
//
// Logo Class
//
// Represents the community logo.
//
//*********************************************************************
[Designer(typeof(ASPNET.StarterKit.Communities.CommunityDesigner))]
public class Logo : WebControl {
SectionInfo objSectionInfo;
//*********************************************************************
//
// RenderContents Method
//
// Display the logo image.
//
//*********************************************************************
protected override void RenderContents(HtmlTextWriter writer) {
// Get the SectionInfo
objSectionInfo = (SectionInfo)Context.Items["SectionInfo"];
// Do we have a logo image?
if (objSectionInfo.Logo.Trim() != String.Empty)
RenderLogoImage(writer);
}
void RenderLogoImage(HtmlTextWriter writer) {
writer.AddAttribute(HtmlTextWriterAttribute.Href, CommunityGlobals.ResolveBase("default.aspx"));
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.Write(String.Format("<img src=\"{0}\" border=\"0\" />", objSectionInfo.Logo));
writer.RenderEndTag();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -