WHAT ARE THE TWO BASE CLASSES A WEBPART YOU ARE GOING TO USE WITHIN SHAREPOINT 2007 CAN INHERIT FROM?

Awadhendra Tiwari

Total Post:510

Points:2550
Posted by  Awadhendra Tiwari
 2034  View(s)
Ratings:
Rate this:
  1. Awadhendra Tiwari

    Post:510

    Points:2550
    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!