Sharepoint Web Parts
What Are Web Parts?
Web Parts are server-side controls that run inside the context of site pages in Microsoft SharePoint Foundation. There are many Web Parts available by default, and you can also build your own custom Web Parts.
Web Part Types
There are two different types of Web Parts in SharePoint.
ASP.NET Web Part
These Web Parts are built using the ASP.NET Web Part infrastructure. The ASP.NET-style Web Parts have a dependency on System.Web.dll and must inherit from the WebPart base class in the System.Web.UI.WebControls.WebParts namespace. These Web Parts can be used in ASP.NET applications as well as in SharePoint Foundation, making them highly reusable.
SharePoint-based Web Part
These have a dependency on Microsoft.SharePoint.dll and must inherit from the WebPart base class in the Microsoft.SharePoint.WebPartPages namespace. These Web Parts can only be used in SharePoint Web sites.
Custom Web Parts
Custom Web Parts allow you to create user interface elements that can be customised and personalised. The term customization implies that changes are seen by all site members. Individual users can further personalize Web Parts page by adding, reconfiguring, and removing Web Parts. The term personalization implies that these changes will be seen only by the user that made them. A site owner or a site member with the appropriate permissions can customize Web Parts page by using a browser or by using Microsoft SharePoint Designer to add, reconfigure, or remove a Web Part.
Because the SharePoint Foundation Web Part infrastructure is built on top of the ASP.NET Web Parts control set, ASP.NET developers can quickly create robust custom Web Parts. Developers can extend SharePoint sites by creating custom Web Parts, to add the extra dimensions of user customization and personalization.
By harnessing the power of custom Web Parts. You can:
- Create custom properties that you can display and modify in the user interface.
- Implement proprietary code without disclosing the source code.
- Secure and control access to content within the Web Part. Built-in Web Parts allow any users with appropriate permissions to change content and alter Web Part functionality. With a custom Web Part, you can determine the content or properties to display to users, regardless of their permissions.
- Make your Web Part connectable.
- Interact with object models that are exposed in SharePoint Foundation (formally known as WSS).
- Use a rich development environment with debugging features that are provided by tools such as Microsoft Visual Studio 2010.
Read more on Developing Professional Web Parts and Custom Controls with ASP.NET 2.0 (Wrox Professional Guides)
