WebPartMobileAdapter.OnInit method

Replaces the OnInit(EventArgs) method of the control that is being adapted.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

protected override sealed void OnInit(
	EventArgs e
)

Parameters

e
Type: System.EventArgs

An object that contains data for the event.

This method does not derive from the OnInit(EventArgs) method of the control that is being adapted, but it “overrides” it in a broad sense because when there is an adapter for the current browser, the adapter’s OnInit(EventArgs) method is called, not the control’s. The control’s OnInit(EventArgs) method, however, is called indirectly by the adapter’s.

This override calls the OnInitForMobile(EventArgs) method if the control is on a WebPartMobilePage; otherwise, it calls the base OnInit(EventArgs) method. Ultimately, after each layer of adapter class has done its initialization and called its parent’s OnInit(EventArgs) method, the OnInit(EventArgs) method of the control that is being adapted is called.

Show: