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"/>
當我試圖調試二傳手從來沒有所謂。