Compartilhar via


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)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Protected Overrides NotOverridable Sub OnInit ( _
    e As EventArgs _
)
'Usage
Dim e As EventArgs

Me.OnInit(e)
protected override sealed void OnInit(
    EventArgs e
)

Parameters

Remarks

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.

See Also

Reference

WebPartMobileAdapter Class

WebPartMobileAdapter Members

Microsoft.SharePoint.WebPartPages Namespace