讀書筆記——asp.net 2.0 伺服器組件和控制項進階編程0622
來源:互聯網
上載者:User
1.HtmlTextWriter
protected override void Render(HtmlTextWriter writer)
2.GAC 程式集名 版本 文化 公開金鑰標記
[assembly:AssemblyCulture("")]
[assembly:AssemblyVersion("1.0.0.0")]
[assembly:AssemblyKeyFile("KeyFile.snk")]
強命名程式集
3.取得公開金鑰
sn -k keyfile.snk
4.屬性(property/Attribute)
屬性名稱和值 BrowsableAttribute
說明 DescriptAttribute
預設值 DefaultValueAttribute
類別分組 CategoryAttribute
5.控制項預設屬性 DefaultPropertyAttribute
應用屬性 ToolboxDateAttribute
Exp. [ToolboxData("<{0}:Controlname ...........></{0}:Controlname>")]
6. Tagprefix :Assemblyinfo.cs
[assembly:Tagprefix("customComponents","custom")]
7.枚舉
HtmlTextWriterTag
HtmlTextWriterAttribute
HtmlTextWriterStyle
8.狀態
ASP.net處理新的請求時,則建立新的頁面對象,完成後則釋放
屬性get set 訪問器必須委託給ViewState,而不是似有欄位
public string fieldname
{
get{return ViewState["f"] != null ? (string)ViewState["f"]:""}
set{ViewState["f"] = value;}
}
9.使用者控制項 .ascx