Working with the Windows SharePoint Services WebPart Class

The Windows SharePoint Services 3.0 WebPart class has been rebased to inherit from the Microsoft ASP.NET 2.0 WebPart class, providing a compatibility layer to ensure that Web Parts written for Windows SharePoint Services 2.0 work in Windows SharePoint Services 3.0 without modification. It exists primarily for the purpose of backward compatibility, and secondarily, to provide a small set of features that are not available in the ASP.NET WebPart class.

Note

The Windows SharePoint Services WebPart class is part of the Web Part infrastructure that was designed specifically for Windows SharePoint Services 2.0 sites.

Windows SharePoint Services Web Part Inheritance Model

The Windows SharePoint Services Web Part infrastructure is now built on top of ASP.NET 2.0 and uses many of the controls in the ASP.NET Web Part control set, as well as introducing several of its own controls that inherit from base classes supplied by the ASP.NET Web Part control set.

The following diagram demonstrates the inheritance hierarchy for the Windows SharePoint Services WebPart class.

WebPart class inheritance

Windows SharePoint Services 2.0 Web Part Behavior in Windows SharePoint Services 3.0

The Windows SharePoint Services team has gone to great lengths to ensure that your Windows SharePoint Services 2.0 Web Parts work seamlessly in Windows SharePoint Services 3.0. There are a small number of cases, however, in which your 2.0 Web Parts may behave differently. This list follows:

  • In Windows SharePoint Services 2.0, Web Parts belonged to zones; however, in Windows SharePoint Services 3.0, Web Parts belong to the SPWebPartManager. If you use a Web Part's Parent property, you get a reference to SPWebPartManager rather than a reference to the containing WebPartZone.

  • In Windows SharePoint Services 2.0, both provider and consumer Web Parts can have multiple connections. In Windows SharePoint Services 3.0, the provider part can have multiple connections but the consumer part can have only one connection (same as that of ASP.NET 2.0 Web Part controls). You can replicate Windows SharePoint Services 2.0 behavior, however, by specifying UnlimitedConnections on the consumer Web Part.

See Also

Reference

Microsoft.SharePoint.WebPartPages