Examining Master Pages
- Posted: Dec 18, 2005 at 4:51 PM
- 16,271 Views
- 1 Comment
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Over the years Web developers have struggled with a variety of techniques to try and create template based sites. Unfortunately, none of these have been generic and easy to maintain. The introduction
of Master pages is designed to solve this problem.
Conceptually master pages consist of two elements: Master Page and Content Page. Master pages act as the templates for the Content Pages, and Content Pages provide content to populate pieces of
Master Pages. A Master Page is essentially a standard ASP.NET page except that it used the extension of .master and a <%@ master %> directive instead of <%@ page %>. This Master Page file serves as the template for other pages, so typically it will contain
the top-level HTML elements, the main form, headers, footers, and such. Within the Master Page you add instances of the
ContentPlaceHolder control at locations where you want Content Pages to supply page-specific content.
The Content Pages are just ordinary .aspx files that specify an associated Master Page in their page directive using the
masterpagefile attribute. These pages contain only instances of the Content control as they are used to
to supply content for the inherited Master Page template. Each Content control must map to a specific
ContentPlaceHolder control defined in the referenced Master Page, the contents of which is inserted into the Master Page's placeholder at rendering time.
In this screencast, Thom examines some of the uses for Master Pages.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Many Thanks
Remove this comment
Remove this thread
close