Skip to main content

70-562 Web Parts


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

Popular posts from this blog

Rxjs Forkjoin vs Zip

These Rxjs combination operators are handy to make Rest calls in parallel and combine their results. Both take n observables and will return the results, with the difference that forkJoin will complete even if one of the nested observables errors of completes.

React JS Patterns

React JS is always evolving, and evolving quickly. These evolutions can be very significant ones, for example, the addition of hooks. React has a lot of code patterns, often these patterns are motivated by the DRY and/or the open-close principle. These patterns sometimes come in to replace a previous one, yet the previous ones still stays in use, as a consequence, the list of patterns keep growing. The goal of the next few posts will be to list the patterns commonly used in React JS developpement. Some patterns are more specific to JSX and I will start with these, and maybe add patterns specific to Redux.

Object.create vs. Object.Assign

The two functions return a new Object but with a difference. Object.assign will go through an enumerable and copy it's properties. Object.create will create a new empty object but link it's proto chain to the old object. One way to view this is with JSON.stringify(newCreatedObject) this would return an empty object, since all the properties are not part of the object's own properties, but inherited through prototype inheritance. In both case, the advantage is it allows to extended existing objects without modifying the original. This is particularly important when receiving arguments from a caller, in this case it's better to use these methods instead of modifying the caller's object since he might have planned to use it again later, expecting it to be in it's original state.