Page.RequiresControlState(Control) Page.RequiresControlState(Control) Page.RequiresControlState(Control) Method

定義

判斷指定的 Control 物件是否已註冊要參與控制項狀態管理。Determines whether the specified Control object is registered to participate in control state management.

public:
 bool RequiresControlState(System::Web::UI::Control ^ control);
public bool RequiresControlState (System.Web.UI.Control control);
member this.RequiresControlState : System.Web.UI.Control -> bool

參數

control
Control Control Control

檢查其控制項狀態需求的 ControlThe Control to check for a control state requirement.

傳回

如果指定的 Control 要求控制項狀態,則為 true,否則為 falsetrue if the specified Control requires control state; otherwise, false

備註

控制項狀態是重要需要函式,Web 伺服器控制項的檢視狀態資料所組成的物件它包含在不同的物件,從一般的檢視狀態。Control state is an object composed of critical view-state data that Web server controls need to function; it is contained in a separate object from normal view state.

使用控制項狀態的自訂控制項必須呼叫RegisterRequiresControlState方法,然後再儲存控制項狀態。Custom controls using control state must call the RegisterRequiresControlState method before saving control state. 使用RequiresControlState方法來檢查已向頁面需要控制項狀態的控制項。Use the RequiresControlState method to check for controls that are registered with the page as requiring control state.

適用於

另請參閱