MenuAdapter::OnInit Method
Registers the associated Menu control as one that requires control state.
Assembly: System.Web (in System.Web.dll)
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 InheritorsIf 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 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.