After the success of design move in visual studio with dragging and dropping controls to design them, Microsoft brought this to the end user in sharepoint and then to all web applications with Web Parts.
The idea is that users should be able to personalize the page they visit often and tinker to their hearts content.
In this section we will see web parts as a sever control and techniques to make web parts effective.
Authorized users can make site wide changes(shared data) and individual users can override them.
The information is stored in the same database as the membership data, simply in the App_Data directory by default.
In the upper right corner a small arrow can allow to minize the Web Part.
the webParts element in the web.config file contains the security that indicates which users have priviledged access.
Design and Edit mode: are the two modes a web part page can be in. Design is rearange and edit allows to modify behaviors by setting properties.
Users in edit mode have access to the edit menu that allows to edit properties, done in the editor zone.
Web parts can be moved within web part zones, when dragging a web part to a destination, the destination has to be a web part zone.
Catalog mode: allows to add and remove existing parts, import and add parts.
Not all the web parts are the same, menus contain different verbs, web parts coming from catalog will have a delete verb.
It is also possible to add custom verbs, like verify to.
It is possible to provide data from one web part to another.
You can add custom properties and decide if they are editable in shared scope or use scope. Some properties can be made read-only.
How to import and export settings for web parts? Export allows to save data from the webpart to a file on disk in xml data. You can import web parts from the catalog mode.
To edit a web part, you go in edit mode, and select edit from the web part's menu.
The controls are available from toolbox in vs.
WebPartManager: has no UI, just manages behavior, mode, storage, and data exchange between web parts, there is one manager per page, typically in master page or user control.
WebPartZone control: Acts as a container for web parts, lets you embed html, one contains a zone template.
CatalogZone: only when in this mode, DeclarativeCatalogPart, PageCatalogPart, ImportCatalogPart.
EditorZone: contains a zone template, and place any EditorParts you need to customize. PropertyGridEditorPart will add controls for each property, for example, checkbox for boolean etc.
ConnectionZone: Lets the user change connection between webParts
There is alot of features in web parts, and it is a little off beat compared to other asp.net features, but can empower users to make your web page, their own, and that's a very good thing.
Comments
Post a Comment