HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Master pages provide templates for other pages of your site.
Master pages allow you to your web application, all the pages (or group of pages) to create a consistent appearance and behavior.
Master pages provide templates for other pages, with shared layout and functionality. Master page to define the contents of the page content can be covered by a placeholder. The output is a combination of master pages and content pages.
Content pages contains the content you want to display.
When users request the content page, ASP.NET pages will be combined to produce a combination of the master page layout and content pages of output.
The above master page is a page designed for other ordinary HTML template page.
@ Master directive defines it as a master page.
Master page contains a placeholder for individual tag<asp: ContentPlaceHolder>.
id = "CPH1" attribute identifies the placeholder, allowing multiple placeholders in the same master page.
The master page is saved as"master1.master".
NOTE: The master page can also contain code, allowing dynamic content.
The content page above is independent of the site content in a page.
@ Page directive defines it as a standard content page.
Content page contains content label<asp: Content>, the label refers to the master page (ContentPlaceHolderId = "CPH1").
The content of the page is saved as"mypage1x".
When the user requests this page, ASP.NET master page will be merged with the page content.
Note: The contents of the text must be located in <asp: Content> tag inside. Content of the text-label is not allowed.
The content page above demonstrates how .NET controls to insert content pages, like the insertion of a normal page.