The difference between Asp.Webpart and WSS.Webpart baseclass

From:http://www.pointsharepoint.com/2008/08/whats-web-part-how-many-types-of-web.html

Web Parts as defined by MSDN are an integrated set of controls for creating Web sites that enable end-users to modify the content, appearance, and behavior of Web pages in a browser.
In Windows SharePoint Services 3.0 Web Parts ultimately derive from the ASP.WebPart (System.Web.UI.WebControls.WebParts) base class; however, Windows SharePoint Services 3.0 also has a Web Part base class (Microsoft.SharePoint.WebPartPages.WebPart) derived from the ASP.WebPart class. If you are developing Web Parts you can elect to derive from either the Asp.WebPart or WSS.WebPart; however you should carefully consider your approach before developing custom Web Parts for use with Windows SharePoint Services 3.0. To help define the differences, we'll examine each class and their respective pros and cons.

ASP.NET Web Parts
When deriving from the ASP.WebPart your Web Part derives directly from the ASP.WebPart class which does not have a dependency on Windows SharePoint Services 3.0 code so it can be used in both ASP.NET Web sites or a Windows SharePoint Services 3.0 site collection/Web. To ensure the Web Part customization is sustainable you should consider using the ASP.WebParts. ASP.WebParts are exportable using the .webpart extension, can be displayed in SPD using attribute markup and are persisted to the Windows SharePoint Services store in binary Web Part format.

Hybrid (ASP.NET 2.0 + Windows SharePoint Services Web Parts)
Hybrid Web Parts typically derive from the Wss.WebPart base class; however, adhere to the design guidelines for ASP.WebParts though the dependency on WSS.WebPart implies its use strictly in a Windows SharePoint Services 3.0 site collection/Web. Hybrid Web Parts should be considered only where features provided in the WSS.WebParts class are required, for example, client-side connections. Hybrid Web Parts can also be used in version to version upgrades where the existing legacy hybrid Web Part cannot be retired in favor of a ASP.WebPart. Hybrid Web Parts are exportable using the .webpart extension, can be displayed in SPD using attribute markup and are persisted to the Windows SharePoint Services store in binary Web Part format.

Windows SharePoint Services Web Parts
WSS Web Parts derive from the WSS.Web Part base class and meet the guidelines as provided by the Windows SharePoint Services 2.0 Web Part design guidelines. The WSS.WebPart class is obsolete and is retained solely for backwards compatibility. Wss.WebParts are exportable using the .dwp extension, can be displayed in SPD using XML Markup and are persisted to the WSS store in a compressed XML format.

The bottom line is, if you are considering developing custom Web Parts you should consider deriving from the System.Web.UI.WebControls.WebParts.WebPart class and referencing the MSDN guidance on developing ASP.NET Web Parts to ensure the Web Parts to maximize interoperability and sustainability.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值