共用方式為


WebPart.OnUnload method

System.Web.UI.Control.Unload事件,正在從記憶體卸載網頁組件時發生的事件處理常式。

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

Syntax

'宣告
Protected Overrides Sub OnUnload ( _
    e As EventArgs _
)
'用途
Dim e As EventArgs

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

參數

  • e
    Type: System.EventArgs

    System.EventArgs物件,其中包含System.Web.UI.Control.Unload 事件的資料。

備註

如果您的網頁組件需要執行任何最終清除在關閉前,例如關閉檔案,關閉的資料庫連線,並捨棄物件,您只需要訂閱System.Web.UI.Control.Unload事件將適當的事件處理常式新增至網頁組件建構函式。例如:

this.Unload += new EventHandler (MyUnloadHandler);

請參閱

參照

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace