2011-01-11 147 views

回答

5

這是一堂課。添加一個公共財產。

4

假設ASP.NET 3.5 +剛剛創建屬性

公共字符串YourProperty {獲得;設置;}

將是對控制

+0

@user:這適用於ASP.NET 1.0+ – 2011-01-11 16:07:29

1

添加屬性在asp.net自定義聲明性控制不大於在C#上的任何類添加一個屬性(例如)不同的。

public class Custom : Control 
{ 
    public string Text { get; set; } 
} 
1

只是將其添加爲公共屬性,那麼它應該可用於您的需求。