Bewerken

Delen via


MenuAdapter.OnInit(EventArgs) Method

Definition

Registers the associated Menu control as one that requires control state.

protected public:
 override void OnInit(EventArgs ^ e);
protected internal override void OnInit (EventArgs e);
override this.OnInit : EventArgs -> unit
Protected Friend Overrides Sub OnInit (e As EventArgs)

Parameters

e
EventArgs

The EventArgs data associated with this event.

Remarks

The OnInit method registers the associated control as one that requires control state. By default, the .NET Framework calls the Web server control's own OnInit method. However, after the Adapter property of the server control is set, the .NET Framework will call the adapter's implementation of the OnInit method instead of the control's implementation.

Use the OnInit method to initialize settings in the control. During a postback, this is an important phase for managing interaction with existing view-state data. For more information, see Architectural Overview of Adaptive Control Behavior.

Notes to Inheritors

If the adapter overrides the OnInit(EventArgs) method, it must call the corresponding method on the base class. Otherwise, the control's own Init event will not be raised.

Applies to

See also