?? itemviewcount.cs
字號:
namespace ASPNET.StarterKit.Communities {
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Diagnostics;
//*********************************************************************
//
// ItemViewCount Class
//
// Represents a view count displayed in a template
//
//*********************************************************************
public class ItemViewCount : WebControl {
public ItemViewCount() {
CssClass = "itemViewCount";
EnableViewState = false;
}
override protected void OnDataBinding(EventArgs e) {
ContentItem item;
if (NamingContainer is ContentItem)
item = (ContentItem)NamingContainer;
else
item = (ContentItem)NamingContainer.NamingContainer;
ContentInfo objContentInfo = (ContentInfo)item.DataItem;
ViewState["ViewCount"] = objContentInfo.ViewCount;
}
override protected void RenderContents(HtmlTextWriter writer) {
writer.Write(ViewState["ViewCount"]);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -