in short, master pages greatly simplify the task of making a Web application look consistent, regardless of how many pages are involved.
content pages are attached to a master-page and define content for any contentplaceholder controls in the master page. The content page contains <asp:content> controls that reference the <asp:contentplaceholder> controls in the master page through the contentplaceholder ID. The content pages and the master page combine to form a single response.
<%@ page language="VB" master="~/Mysite.master" %><asp:content id="Content1" contentplaceholderid="LeftSideContent"> <H2>Navigation </h2> <asp:treeview id="Navigation tree" runat="server" datasourceid="NavSource"/></asp:content><asp:content id="Content1" contentplaceholderid="RightSideContent"> <asp:label runat="server">Support section</asp:label></asp:content>
once again, the user actually makes a request for the content page. ASP.NET notices the reference to the master page and renders the master page content in combination with the content page.
in certain instances, master pages must be nested to achieve increased control over site layout and style. For example, your company may have a Web site that has a constant header and footer for every page, but your accounting department has a slightly different template than your IT department.
figure 11. Nested Master Pages
by nesting individual department master pages within the top-level company master page, you can implement high levels of consistency for each department while controlling what can be overridden by content and master pages.
the key point to remember is that the end user requests one page and receives one page, even though the application may be compiling content from multiple master pages and content pages.
although the goal of master pages is to create a constant look and feel for all of the pages in your application, there may be situations when you need to override certain content on a specific page. To override content in a content page, you can simply use a content control.
to override a master page dynamically, you have to programmatically expose the public properties of the masterpage class, including those you create. Therefore, if you want to override the <title> and <keyword> properties in the <head> section of your HTML pages, you can build a function to edit the default properties set in the master page:
<head runat="server" id="Head1"> <title><% =m_HtmlTitle %></title> <meta name="keywords" content="<% =GetKeywords() %>" > <meta name="description" content="A newsletter focused on meeting the needs of .NET developers, providing cool tips for the advanced programmer, and keeping you informed on what''s happ