In the current web design, more emphasis on the user's personalized settings, so that users can freely set the page to meet their preferences to become the site developers of the number one problem, but now it seems that the problem Microsoft helped us solve. A new set of WebPart controls has been added to ASP.net 2.0 to make it easy for users to adjust the layout of each area of the page. In some Web applications, webpart controls can be used if users want to customize the layout of a page, such as a news release system, and want to switch positions on the left, middle, and right three columns.
Let's look at some basic usages of the WebPart series controls in ASP.net 2.0.
First, in the Toolbox in Vs.net 2005, you can find the WebPart series controls shown in the following illustration, many of which are limited to space, and this article describes some of these important controls:
In a WebPart series control, where the WebPartManager control is used to unify the management of the WebPart controls. The WebPartZone control, in turn, provides zoning where users can place a wide variety of controls inside, and when they are running, the area where the WebPartZone controls can be moved.
To enhance our understanding, let's start with a simple example.
1, first Use vs.net 2 (or RC1) to create a new Web site,
2, drag a WebPartManager control to the form, and then build a 3-column 1-row table, drag each cell into a WebPartZone control, the following figure:
3. Drag and drop a calendar control into the WEBPARTZONE1 and choose a suitable style for the calendar control
4. Switch to Code view state to change the title property of the Calendar control to: today's date. Note that the Calendar control itself does not have the title property, but when a control is added to the WebPartZone area, the control is automatically wrapped as a GenericWebPart type control, which has a title property.
5, at this time, we can press F5 to run the program, run as shown in the following figure, you can see that the region's upper right corner has minimized and closed, restore the button.