What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?

Total Post:505

Points:2525

 2752  View(s)
Ratings:
Rate this:
  1. What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?

    There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the SharePoint WebPart Base class or the ASP.NET 2.0 WebPart base class. When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class:

    1) Cross page connections

    2) Connections between Web Parts that are outside of a Web Part zone

    3) Client-side connections (Web Part Page Services Component)

    4) Data caching infrastructure

Answer