2013-03-28 48 views
1

任何機構都可以解釋爲什麼如果我在控制中保護了屬性,它不能從.aspx中設置?.aspx上受保護的屬性設置器不起作用

控制:

public partial class SomeUserControl : UserControl 
{ 
    protected bool SomeProperty 
    { 
     get { return ViewState["SomeProperty"] != null && (bool) ViewState["SomeProperty"]; } 
     set { ViewState["SomeProperty"] = value; } 
    } 

    ... 
} 

宣言中的.aspx:

<custom:SomeUserControl ID="SomeUserControl1" runat="server" SomeProperty="true"/> 

當我試圖調試二傳手從來沒有所謂。

回答

0

只是意識到它不可見與intellisense。這個屬性被認爲是HTML屬性。

相關問題