Partilhar via


WebPart.Dispose Method

Releases all resources used by the Web Part.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Overrides Sub Dispose
'Usage
Dim instance As WebPart

instance.Dispose()
public override void Dispose()

Implements

IDisposable.Dispose()

Remarks

Override the Dispose method when you want to explicitly free memory for your Web Part and its associated system resources (if any). Use this method if it is necessary to explicitly clean up instead of waiting for the garbage collector to call the Web Part infrastructure's destructor.

See Also

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace