This documentation is archived and is not being maintained.

WebPart.OnPreRender Method

Windows SharePoint Services 3

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

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

protected override void OnPreRender(
	EventArgs e


Type: System.EventArgs
A System.EventArgs that contains the event data.

If your Web Part must perform any necessary prerendering steps prior to 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's constructor. For example:

this.PreRender += new EventHandler (MyPreRenderHandler);