WebPart.RequiresWebPartClientScript method

Indicates whether this Web Part has client-side script to register with the Web Part Page Services Component (WPSC) framework.

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


Protected Friend Overridable Function RequiresWebPartClientScript As Boolean
Dim returnValue As Boolean

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

Return value

Type: System.Boolean
true, indicating that the Web Part does have client-side script to register.


In the base class, this method always returns true. (In fact, that is all it does.) If your Web Part does not require client-side WPSC script support, you should override the RequiresWebPartClientScript method and return false.


This example shows how a Web Part that does not need client-side script support should advertise that fact.

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

See also


WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace