Web Parts in Action

 

Web Parts in Action

To understand what Web Parts can do, you have to see them in action. In a new Web site that I named WebParts, I added a few Web Parts and a drop-down list. The Web site runs in Browse mode by default, as shown in Figure 4-1.

image from book
Figure 4-1: Default.aspx in the WebParts Web site, shown in Browse mode

In addition to the label and the drop-down list, this page has two other controls, identified as Untitled [1] and Untitled [2]. These are Web Parts. If you click the down arrows in one of the title bars, a menu appears that allows you to minimize or close the Web Part. Note that if you close the Web Part, the page remembers this action, and the Web Part will still be closed when you return to the page.

When you change the mode from Browse to Design, the page reloads and looks as shown in Figure 4-2.

image from book
Figure 4-2: Default.aspx in the WebParts Web site, shown in Design mode

In addition to the controls that were visible in Browse mode, a couple of other elements appear in Design mode. Two parts of the page are enclosed in boxes. These are Web Part zones. Web Part zones are parts of the page into which you can drag and drop Web Parts. For instance, as you drag one of the Web Parts from WebPartZone1 into WebPartZone2, you see a visual indicator that the Web Part zone is ready to accept the Web Part in this case, a blue line that appears in WebPartZone2, as shown in Figure 4-3.

image from book
Figure 4-3: Default.aspx while dragging a Web Part in Design mode

This is very cool! You, as the developer, can create little bits of functionality, which your users can customize and combine in ways that are convenient for them.

Note 

The full drag-and-drop experience works only with Microsoft Internet Explorer.

 


Programming Microsoft Web Forms
Programming Microsoft Web Forms (Pro Developer)
ISBN: 0735621799
EAN: 2147483647
Year: 2005
Pages: 70
Authors: Douglas J. Reilly
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net