共用方式為


WebPart.RequiresWebPartClientScript method

指出此網頁組件是否有用戶端指令碼的網頁組件頁面服務元件 (WPSC) 架構中註冊。

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

Syntax

'宣告
Protected Friend Overridable Function RequiresWebPartClientScript As Boolean
'用途
Dim returnValue As Boolean

returnValue = Me.RequiresWebPartClientScript()
protected internal virtual bool RequiresWebPartClientScript()

傳回值

Type: System.Boolean
true,指出網頁組件中沒有註冊的用戶端指令碼。

備註

在基底類別中,這個方法一定會傳回true。(事實上,即所有其執行)。如果您的網頁組件不需要在用戶端 WPSC 指令碼支援,您應該覆寫RequiresWebPartClientScript方法並傳回false。

Examples

此範例顯示如何網頁組件,不需要用戶端指令碼支援應通告的事實。

protected override bool RequiresWebPartClientScript()
{
    // return base.RequiresWebPartClientScript();
    return false;
} 
Protected Overrides Function RequiresWebPartClientScript() As Boolean
    ' return base.RequiresWebPartClientScript()
    Return False
End Function

請參閱

參照

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace