Master pages provide templates for other pages on your web site.Master PagesMaster pages allow you to create a consistent look and behavior for all the pages (or group of pages) in your web application.A master page provides a template for other pages, with shared layout and functionality. The master pagedefines placeholders for the content, which can be overridden by content pages.The output result is a combination of the master page and the content page.The content pages contain the content you want to display.When users request the content page, ASP.NET merges the pages to produce output that combines the layout of the master page with the content of the content page.Master Page Example. <%@ Master%Standard Header From MasterpageThe master page above is a normal HTML page designed as a template for other pages.The @ Master directive defines it as a master page.The master page contains a placeholder tag for individual content.The id='CPH1' attribute identifies the placeholder, allowing many placeholders in the same master page.This master page was saved with the name 'master1.master'.Note: The master page can also contain code, allowing dynamic content.Content Page Example. <%@ Page MasterPageFile='master1.master'%Individual ContentParagraph 1Paragraph 2The content page above is one of the individual content pages of the web.The @ Page directive defines it as a standard content page.The content page contains a content tag with a reference to the master page (ContentPlaceHolderId='CPH1').This content page was saved with the name 'mypage1.aspx'.When the user requests this page, ASP.NET merges the content page with the master page.Note: The content text must be inside the tag. No content is allowed outside the tag.Content Page With Controls.
Asp Net Web Page Template
In MasterPage system there are MasterPagesand ContentPages, which are two halves of a whole.The MasterPagesets up the shape of the page, and the ContentPage'sĀ contain the actual data that is to be rendered within the spaces set up in the MasterPageĀ (if you will, this is very similarto a Microsoft Word MailMerge operation if you will: one page is the template, another page is the data). You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge withthe master page to produce output that combines the layout of the master page with the content from the content page.You can download a sample code fromReference URLs.