MenuAdapter.OnInit Method

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
)
Not applicable.

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 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 Rendering.

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: