Master Pages

Most Web sites share a common look and feel //统一的外观和感觉on almost every Web page. Typically//典型地 this is implemented via //经由separate files, such as for a header and footer. ASP.NET v1.x supported this with user controls. However, you needed to reference these controls on every page, and there was no design-time support for seeing how the page would look when rendered. You simply saw a gray box representing//表现 the user control.

VWD introduces a feature called Master Pages, a flexible //灵活的page-template based system that allows you to "skin" and control the layout //表现of your entire Web site by modifying only one template. This type of "visual inheritance" greatly reduces the maintenance//维护 and overall //总的complexity //复杂性of your Web site. It also gives you the type of WYSIWYG //所见即所得support you would expect in the Design view.

A Master Page is a just another type of file that you add to your project. It has a .master extension //叫.master的扩展名. You can place any control that you want on a Master Page.  Every page that inherits from//继承自 the Master Page will automatically use the same controls inserted on the Master Page.  The content of a child page//子页面 is placed into a ContentPlaceHolder control.  The net result is the entire format and layout of your Web site can be maintained//维护 by changing a single file.

In this next series of lessons you will create a simple//简单的 Master Page, add new Web pages that inherit from//继承自 the Master Page, and convert //转变existing Web pages to use the Master Page.  Additionally, you will use one of the new navigational //导航的,浏览器的controls in ASP.NET 2.0.

 

 

posted on 2007-04-11 11:27  改变热爱  阅读(188)  评论(0)    收藏  举报

导航