Share via


WebPart.OnPreRender method

The event handler for the System.Web.UI.Control.PreRender event that occurs immediately before the Web Part is rendered to its containing Web Part Page.

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

Syntax

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

Me.OnPreRender(e)
protected override void OnPreRender(
    EventArgs e
)

Parameters

Remarks

If your Web Part must perform any necessary prerendering steps before saving the view state and rendering content during the System.Web.UI.Control.PreRender event, you can add an appropriate event handler to the Web Part constructor. For example:

this.PreRender += new EventHandler (MyPreRenderHandler);

See also

Reference

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace