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)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Protected Overrides Sub OnPreRender ( _
e As EventArgs _
)
'Usage
Dim e As EventArgs
Me.OnPreRender(e)
protected override void OnPreRender(
EventArgs e
)
Parameters
e
Type: System.EventArgsA System.EventArgs that contains the event data.
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);