Notice the down pointing arrow on the left side. That's the Web Parts personalization that was added to your application for very little effort on your part. The color scheme was added with very little effort too. I just selected the smart tag for the zone and selected a preformatted theme. (OK ... I changed one of the colors to match his shirt.)
Now for the limits. You can't do anything with Web Parts. Controls have to be wrapped in a prebuilt zones. There are four "in the box":
- CatalogZone
- ConnectionsZone
- EditorZone
- WebPartZone
These are usually critical controls in a complete page built with Web Parts. For example, The CatalogZone is where you list all of those other Web Parts that people can select from. I just used the generic WebPartZone for everything.
But if these aren't enough for your application, you can define your own by simply inheriting from WebPartZone. For example, Microsoft provides this example of a zone that can be used to select security levels. (Only the Class code is shown. There's more to it than this.)
<AspNetHostingPermission(SecurityAction.Demand, _
Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class MyWebPartZone
Inherits WebPartZone
And there's one more fundamental building block: Display Modes. A display mode puts the entire page into a state that determines exactly what can be done. The default mode is BrowseDisplayMode. That doesn't let you do much.
- BrowseDisplayMode
Displays Web Parts controls and UI elements in the normal mode in which end users view a page. - DesignDisplayMode
Displays zone UI and enables users to drag Web Parts controls to change the layout of a page. - EditDisplayMode
Displays editing UI elements and enables end users to edit the controls on a page. Allows dragging of controls. - CatalogDisplayMode
Displays catalog UI elements and enables end users to add and remove page controls. Allows dragging of controls. - ConnectDisplayMode
Displays connections UI elements and enables end users to connect Web Parts controls.
A display mode must be supported by the Web Parts that will make it work. For example, you can't use CatalogDisplayMode if you don't have a catalog. As it stands, our simple page only allows two modes.
Microsoft Wowee Demo
The Microsoft techies like to do Wowee demos that make it look like you can build web pages much like making a wish with Alladin's Lamp - just wishing it into existance. These demos are supported by careful preparation and rehearsal ... but they sure look good. Here's one for Web Parts.
Our demo will create a complete database update grid in a Web Part in just a few mouse clicks. ... If you have both the website and the database preconfigured.
I've added a very simple database to the App_Data folder and a connection string to support it in Web.Config, and I'm using SQL Server Express. But that's all the setup I need! Now the Wowee magic starts.
Add a User Control to your website. Then drag and drop your User Control into one of your Web Parts in Design view. (I picked the center part where Sirius The Wonder Dog was.) Open the database in Server Explorer and display the list of tables in the database. Drag and drop the table right on the User Control of your page in Design view. (I picked the "Customers" table from my database.)
--------
Click here to display the illustration.
--------
With two drag and drop motions, you have created a complete database maintenance grid. You can even update the database from this view! It's worth taking a few moments to browse all of the boilerplate code that has been added to your project. There's a lot of it.
Of course, there's a lot that can go wrong. That's why the Microsoft techies practice, practice, practice! For example, it you don't drag and drop in Design view, it doesn't work. Things have to be done in just this sequence. I call this sort of magic, "eye of newt and ear of bat" programming. But if you get the magic incantation exactly right, it is fast!

