Preparing to Add Web Parts
Web portal//入口,大门 technology//入门技术 has introduced us to the concept //概念of writing very small Web applications that can be managed by a separate //独立的portal//入门 application. In the past, portal//入口 management functionality—e.g., the ability to control access to portal areas, customizing//用户化 each user's experience, etc.—required you to purchase//购买 portal software such as Microsoft SharePoint Portal Server, which has a framework to manage Web parts.
VWD ships with //自带a comprehensive //综合的,广泛的new Web part management system very similar to SharePoint. Personalization//体现 is supported out-of-the box, allowing users, among other things, to drag and drop Web parts on a page. To support this functionality VWD provides the application glue on top of //粘,胶在什么上面ASP.NET.
In this chapter you will explore//探讨 how to build Web pages with the Web part controls that ship with VWD. To begin using Web parts, you must first place the proper Web part controls on your page.
1. Create a new Web form in your project called WebParts.aspx. Do not use a master page but do use a separate code-behind file. You will need the latter to handle the Web Part mode switching //转换in the next lesson.
2. From the ToolBox drag a WebPartManager control onto the WebParts.aspx design surface. In the Properties window set the ID property to "authorsWebPartManager".

The WebPartManager control manages all //所有the Web parts on the page. Each page that uses Web parts must have this control.
3. Place your cursor below the WebPartManager control and then select Layout | Insert Table menu command to add a single-row, 3-column table // 一行三列的表格to the page, as you see below. Also, click Cell Properties and then for Vertical align select top.

A WebPartZone control is a container for one or more Web Parts. You must add these containers to add Web Parts.
4. Drag a WebPartZone control into the first column//列 of the HTML table. Set its ID property to "leftColWebPartZone".

5. Drag a second WebPartZone control into the second column //列of the HTML table. Set its ID property to "midColWebPartZone".

6. Add the following element //元素to the web.sitemap file: <siteMapNode url="WebParts.aspx" title="Web Parts" description="" />.
You are now ready to start adding Web Parts to your page.
浙公网安备 33010602011771号