October 16, 2007

An intro to ASP .NET WebParts

WebParts are part of the Presentation Layer and empower users with the capability of customizing the contents of the Web page being visualized. A WebPart is a control whose positioning, content and design can be customized effortlessly by the user, creating a richer and easier interaction. A WebPart can be in one of five modes: Browse, for standard navigation; Design, which allows users to minimize and drag WebParts between zones; Edit, on which an EditorZone control is displayed allowing the user to add WebParts properties at runtime; Catalog, on which a CatalogZone control is displayed so that the user can use it to add new Web Parts to the page while navigating; and Connect (not explored yet). The Sentry Customer Interface has its WebParts in Design mode, allowing only their minimization and customization of their position.
WebParts use a WebPartZone as a container and can be moved within their container (to change their position) and between other WebPartZones that exist on the Web page. Almost all controls can be displayed from within a WebPart, using the GenericWebPart control as a wrapper.
The WebPart framework requires a database, local or located on a server, to enable persistence of the customization options. This database is tipically "aspnetdb" and can be created by running the "aspnet_regsql" command. The customization settings are kept in a per-user basis (with the current logged on user by default).

No comments: