MenuAdapter.OnInit Method

Note: This method is new in the .NET Framework version 2.0.

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

Namespace: System.Web.UI.WebControls.Adapters
Assembly: System.Web (in system.web.dll)

protected public:
virtual void OnInit (
	EventArgs^ e
) override
protected void OnInit (
	EventArgs e
)
protected internal override function OnInit (
	e : EventArgs
)

Parameters

e

The EventArgs data associated with this event.

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's control is set, the .NET Framework will call the adapter's implementation of the OnInit method over that of the associated control.

Use the OnInit method to initialize settings in the control. In 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 method, it must call the corresponding method on the base class. Otherwise, the control's own Init event will not be raised.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show: