Export (0) Print
Expand All

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)

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

Community Additions

Show:
© 2014 Microsoft