In this article we will discuss about What are advantages of SharePoint specific webpart class in SharePoint 2010. Also you can check out my previous posts on:
In SharePoint 2010 we can inherit webparts from SharePoint specific base class namely as Microsoft.SharePoint.WebPartPages.WebPart as well as normal Asp.Net base class namely System.Web.UI.WebControls.WebParts.WebPart.
If it uses SharePoint specific class then it is also fully integrated with the ASP.NET Web Parts infrastructure, because the SharePoint’s WebPart class internally inherits from that of ASP.NET.
But these web parts can be used only in SharePoint since it depends on Microsoft.SharePoint.dll.
It is not a best practice to inherit from Microsoft.SharePoint.WebPartPages.WebPart, But still they have some advantages over normal asp.net web part base class.
- It supports SharePoint tool parts.
- You can use these to inject tokens in the output HTML code of a SharePoint Web Part, and then have the SharePoint infrastructure replace them with their corresponding values.
- It supports cross page connections and connection between Web Parts that are outside of a Web Part zone. [Connected web part
- It supports client side connections.
- It also supports data caching, it allows caching of web parts into the content database.