Introduction
Web parts are the new building blocks of personalization in ASP.NET 2.0. Any controlâwhether a standard server control, custom control, user control, or web part controlâcan be used as a web part without modification.
In its simplest form, a web part consists of an ASP.NET server or user control that takes advantage of the Web Parts control set, which is a group of structural components consisting of the following minimum set:
WebPartManager
controlResponsible for managing all other web part controls on the page
WebPartZone
controlDefines an area on a page where web parts can be placed
CatalogZone
controlResponsible for managing the user interface that displays the available web parts and provides the user the ability to select web parts and add them to
WebPartZones
Creating a web part and using the Web Parts control set on an ASP.NET page is a natural first step in learning how to build web parts and is the subject of this chapterâs first recipe.
As you create a stable of web parts, you will find you want to reuse them on many pages in your applications, yet having to declare each web part on each page can be a stumbling block. Creating a reusable web parts catalog circumvents this issue and is the subject of the chapterâs second recipe.
ASP.NET server controls and user controls can be effective when used as web parts. Nevertheless, you may need additional functionality not provided by these controlsâfor example, when you want the ability to build your web parts ...
Get ASP.NET 2.0 Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.