??? [DefaultPropertyAttribute("defname")]??? [ToolboxData(@"<{0}:DefineLabel ??? Text='自定義Text'??? runat='server'></{0}:DefineLabel>")??? ]??? [ParseChildren(false)]
??? public class DefineLabel : Control??? {??????? [BrowsableAttribute(true)]??????? [DescriptionAttribute("自定義Description")]??????? [DefaultValueAttribute("自定義DefaultValue")]??????? public string Text??????? {??????????? get;??????????? set;??????? }
??????? protected override void Render(HtmlTextWriter writer)??????? {??????????? writer.Write("<div style='border:solid 1px silver'>" + Text + "</div>");??????? }??? }
這里面有個DefaultValueAttribute,不知道怎么用,在頁面上也沒有顯示.
還有一個屬性CategoryAttribute,這個是做什么用的啊?
自己做了個例子,也沒看到顯示的效果.
2 回答

蝴蝶不菲
TA貢獻1810條經(jīng)驗 獲得超4個贊
DefaultValueAttribute是該屬性的默認值,就是剛創(chuàng)建的時候就有這個值
CategoryAttribute則是該屬性的分類,例如是控制外觀?還是數(shù)據(jù)等等。
主要都是表現(xiàn)在屬性框里面
- 2 回答
- 0 關(guān)注
- 336 瀏覽
添加回答
舉報
0/150
提交
取消