Page.UnregisterRequiresControlState(Control) Page.UnregisterRequiresControlState(Control) Page.UnregisterRequiresControlState(Control) Method

定義

停止指定之控制項狀態的保存性。Stops persistence of control state for the specified control.

public:
 void UnregisterRequiresControlState(System::Web::UI::Control ^ control);
public void UnregisterRequiresControlState (System.Web.UI.Control control);
member this.UnregisterRequiresControlState : System.Web.UI.Control -> unit

參數

control
Control Control Control

停止其控制項狀態保存性的 ControlThe Control for which to stop persistence of control state.

例外狀況

備註

在保存狀態之前,使用控制項狀態的自RegisterRequiresControlState定義伺服器控制項必須在每個要求上呼叫。Custom server controls that use control state must call the RegisterRequiresControlState on each request during before the state is persisted. 控制項狀態的註冊不會在回傳期間從要求中執行。Registration for control state is not carried over from request to request during a postback. UnregisterRequiresControlState使用方法可確保不會保存不再需要保存以進行回傳之控制項的控制項狀態。Use the UnregisterRequiresControlState method to ensure that control state is not persisted for controls that no longer need to be persisted for postback.

就內部而言UnregisterRequiresControlStateRemovedControl使用方法從控制項集合中移除控制項時,會叫用方法。Internally, the UnregisterRequiresControlState method is invoked when using the RemovedControl method to remove a control from a controls collection.

適用於

另請參閱