Adding a Page that Uses The Master Page
You will now create a Web page that is based on //基于the Master Page you just added to your project.
1. In the Solution Explorer right-click the project and select Add New Item. In the Add New Item dialog select Web Form.For Name enter "ContentPage.aspx". Uncheck Place code in separate file and check Select master page, then click Add.
2. In the Select a Master Page dialog, select MasterPage.master and click OK.

3. Click Design to view the design surface of your new Web page//新建立的WEB页面. Notice that everything except//除了 the Content control is grayed out//灰色不可显. You can only change the content within the enabled control. Enter some text, such as "This is custom content for this Web page". Then press F4 and change the Content control's ID to "bodyContent".

4. Click Source. Notice that there is very little code in this page. All you have is a reference to//参考自 the master page and the Content control tag,//标签 with the content you just entered.
5. Press F5 to run the application.
Notice how easy it was to create a Web page that uses a Master Page and an easily configurable dynamic //动态的navigation menu.
6. Close your browser.
浙公网安备 33010602011771号