15.02.2015 Views

C# 4 and .NET 4

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1212 ❘ ChaPTer 41 Asp.net feAtures<br />

(continued)<br />

ConTrol<br />

BehaviorEditorPart<br />

LayoutEditorPart<br />

PropertyGridEditorPart<br />

ConnectionsZone<br />

desCriPTion<br />

This control enables users to configure the behavior of Web Parts by using<br />

a variety of properties that control, for example, whether a Web Part can be<br />

closed or what URL the title of a Web Part links to.<br />

This control enables users to change layout properties of a Web Part, such as<br />

what zone it is contained in <strong>and</strong> whether it is displayed in a minimized state.<br />

This is the most general Web Part editor control that enables you to define<br />

properties that can be edited for custom Web Part controls. Users can then<br />

edit these properties.<br />

This control enables users to create connections between Web Parts that<br />

expose connection functionality. Unlike CatalogZone <strong>and</strong> EditorZone,<br />

there are no controls to place inside this control. The user interface that this<br />

control generates depends on the controls on the page that are available for<br />

connections. The visibility of this control is dependent on the display mode.<br />

You may notice that this list of controls does not include any Web Parts. This is because you create these<br />

yourself. Any control that you put into a WebPartZone region automatically becomes a Web Part —<br />

including (most importantly) user controls. By using user controls, you can group together other controls to<br />

provide the user interface <strong>and</strong> functionality of a Web Part control.<br />

Web Parts example<br />

To illustrate the functionality of Web Parts, you can look at another of the example web sites in the<br />

downloadable code for this chapter, called PCSWebParts. This example uses the same security database as<br />

the PCSAuthenticationDemo example. It has two users with usernames of User <strong>and</strong> Administrator <strong>and</strong> a<br />

password of Pa$$w0rd for both. You can log in as a user, manipulate the Web Parts on the page, log out,<br />

log in as the other user, <strong>and</strong> manipulate the Web Parts in a completely different way. The personalization for<br />

both users is retained between site visits.<br />

After you have logged in to the site, the initial display (with user logged in) is as shown in Figure 41-8.<br />

figure 41-8<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!