chapter 5 (master page)

9
Chapter 5 ហោ សូ ហនឿន ASP.NET (Master Page) 1

Upload: lets-go-to-study

Post on 17-Feb-2017

170 views

Category:

Education


2 download

TRANSCRIPT

Chapter 5

ហោ សូហនឿន ASP.NET (Master Page) 1

Introduction

ហោ សូហនឿន ASP.NET (Master Page) 2

Master pages are an easy way to provide a template that can be used by any number of ASP.NET pages in your application.

In working with master pages, you create a master file that is the template referenced by a subpage or content page.

Master pages use a .master file extension, whereas content pages use the .aspx file extension you’re used to; but content pages are declared as such within the file’s Page directive.

You can place anything you want to be included as part of the template in the .master file.

This can include the header, navigation, and footer sections used across the Web Application.

The content page then contains all the page content except for the master page’s elements. At runtime, the ASP.NET engine combines these elements into a single page for the end user.

Consideration for a Master Page

ហោ សូហនឿន ASP.NET (Master Page) 3

The website’s name on the top of the page

A navigation breadcrumb at the top of the page

A navigation TreeView on the left of the page,

showing the site’s structure

A copyright statement and a series of links

Creating a New Master Page

ហោ សូហនឿន ASP.NET (Master Page) 4

Adding “contentPlaceHolder” a Master Page

ហោ សូហនឿន ASP.NET (Master Page) 5

Attaching a Master Page to a Web Page

ហោ សូហនឿន ASP.NET (Master Page) 6

Create a master page that specifies the common,

site wide user interface elements and the regions

that are customizable on a page-by-page basis.

Create the site’s ASP.NET pages, with the pages

configured to use the master page created in step 1.

Coding a Content Page

ហោ សូហនឿន ASP.NET (Master Page) 7

Master Page

ហោ សូហនឿន ASP.NET (Master Page) 8

សំនួរ រលឹំក និងស្រាវជ្រាវ

ហោ សូហនឿន ASP.NET (Master Page) 9

1. ត ើ Master Page មានជ្ររតោជន៏អ្វីដល់ការរតងកើ Website?

2. ត ើ ContentPlaceHolder ាអ្វី? 3. ត ើព ៌មានអ្វីខ្លះគួរជ្រ ូវបានដាក់តលើ Master Page?

4. ត ើ thems ាអ្វី? 5. ត ើ Skins ាអ្វី? 6. ត ើតគរតងកើ Nested Master Page ដូចតតេច?