Master page is a very useful mechanism in ASP.NET to create a uniform layout for all pages. It can contain one or more placeholders where the actual content is stored. Master page is always the same and provides a kind of scaffolding for the rest of the pages. Because master page is always the same it defines look and feel for all pages on your website. The rest is saved in a so called content placeholders that finally are merged with master pages and whole page is rendered.
Take a look at the following picture to see how a webpage is merged:

In .NET master pages have .master extensions. You create them in the same way you create normal aspx file. On top of such a file there is a special directive:
On the other hand content pages are also standard aspx files where you put only content of a concrete page, you don't have to bother about layout which is dealt with by masterpage. On top of the content page you have to point master page using following directive:
Take a look at the default page generated by Visual Studio after creating new web application. It creates master page with one content placeholder:

In the picture you can see content placeholder marked in green, the rest is a master page.
Advantages of Master Pages
If you're wandering why you should start using master pages take a look at the following list:
- Creating websites using master pages usually requires less work because you create a template of website and then just add content to it.
- Consistent look and feel - because there is only one master page each webpage has exactly the same design.
- It's flexible - if you want to change something in look and feel of your website you can just edit master page, then each of your pages will also be changed.
- You can use pages designed for content placeholders also in you other projects. For example you can use contact page on various websites with different designs because it usually remains the same.
- There are mechanisms that allow you to change master page from each content page.
- It's easy to change final layout of your pages.
Closing remarks
Summing up master pages are very useful in web design. If you haven't used it yet you should definitely try it because creating a websites will be faster, more efficient and easier. It will also result in more consistent and flexible pages.
If you want to lear more about master pages check out our previous tutorials.