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)

Syntax

protected internal virtual bool RequiresWebPartClientScript()

Return value

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

Remarks

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.

Examples

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;
} 

See also

Reference

WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace