?? viewcount.cs
字號:
namespace ASPNET.StarterKit.Communities {
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//*********************************************************************
//
// ViewCount Class
//
// Represents the number of times a content item has been viewed
//
//*********************************************************************
public class ViewCount : WebControl {
public ViewCount() : base() {
CssClass = "viewCount";
}
//*********************************************************************
//
// RenderContents Method
//
// Display content by retrieving content from context
//
//*********************************************************************
override protected void RenderContents(HtmlTextWriter writer) {
// Get PageInfo object
ContentInfo objContentInfo = (ContentInfo)Context.Items["ContentInfo"];
// Write view count
writer.Write(objContentInfo.ViewCount);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -