What is a Web Part?
To users, a Web Part is simply a piece of a webpage that they can customize from a web browser interface. For example, users can even add and remove Web Parts from pages (often called Web Part pages) by choosing Web Parts from a server gallery or from an online public gallery.
For developers, a Web Part is a class that defines code for rendering its content in the browser, for handling custom configuration, layout, positioning, and so on, within the SharePoint or ASP.NET environment. More importantly, developers can reuse Web Parts in many different pages and sites, simplifying custom solution development, deployment, and maintenance. In fact, many SharePoint solutions are based on a set of custom Web Parts that are referenced in pages.
Web Part architecture
A Web Part is an ASP.NET custom control that inherits from the base class WebPart from the System.Web.UI.WebControls.WebParts namespace. To be able to fully use a Web Part in a page, you need to define a WebPartZone control, which is a container for a set of Web Parts. The WebPartZone control provides a common rendering pattern to all its constituent Web Parts. Another fundamental control in the Web Parts architecture is the WebPartManager, which handles all the tasks related to Web Part lifetime management—such as loading and unloading them, as well as serializing and deserializing their state within the current page and connecting Web Parts into Web Part zones.
SharePoint has its own WebPartZone controls that give you the ability to define a set of SharePoint-specific rendering zones, such as the WebPartZone class for standard Web Part rendering and the EditorZone class to render parts responsible for editing other Web Parts.
Overall architecture of a Web Part page in SharePoint and ASP.NET
No comments:
Post a Comment