<p>I've just been learning about master pages in ASP.NET 2.0.  </p>

<p>They sound great, but how well do they work in practice?  </p>

<p>Does anybody have experience of using them for a large web site?</p>

[{'answer_id': 6720, 'author': 'Matt Mitchell', 'author_id': 364, 'author_profile': 'https://Stackoverflow.com/users/364', 'pm_score': 4, 'selected': True, 'text': "<p>I'm pretty sure I've only used master pages in the context of ASP.NET MVC so I'm not sure if it differs from web forms but in my experience they are not only excellent but I couldn't imagine not using them.  Master pages are code inheritance to web pages.</p>\n"}, {'answer_id': 6735, 'author': 'tags2k', 'author_id': 192, 'author_profile': 'https://Stackoverflow.com/users/192', 'pm_score': 1, 'selected': False, 'text': "<p>They are extremely useful, especially in a CMS environment and for large sites, and as MattMitchell says it's inconceivable that you would build a large site without them.</p>\n\n<p>Select template, each template has different editable areas, job done.  Master pages can also be inherited, so you can have a Style.Master, derive a Header.Master, then derive all of your layout-based templates from that.</p>\n"}, {'answer_id': 6741, 'author': 'y0mbo', 'author_id': 417, 'author_profile': 'https://Stackoverflow.com/users/417', 'pm_score': 0, 'selected': False, 'text': "<p>Master Pages have made building template-able websites easy.</p>\n\n<p>I think the trickiest part in building a website using master pages is knowing when to put things into the master page and when to put things into the ContentPlaceHolder on the child page. Generally, dynamic stuff goes into the placeholder while static items go into the master page, but there is sometimes a gray area. It's mostly a design/architecture question.</p>\n"}, {'answer_id': 6744, 'author': 'mbillard', 'author_id': 810, 'author_profile': 'https://Stackoverflow.com/users/810', 'pm_score': 3, 'selected': False, 'text': '<p>They are a must if you want to maintain the look of your application throughout all the pages in the application.</p>\n\n<p>They are fairly easy to use:</p>\n\n<p>First of all, design your master page and define where you want the content to be placed:</p>\n\n<pre><code>&lt;%@ Master ... %&gt;\n\n&lt;%-- HTML code --%&gt;\n&lt;asp:ContentPlaceHolder id="plhMainContent" runat="server" /&gt;\n&lt;%-- HTML code --%&gt;\n</code></pre>\n\n<p>You can have any number of place holders, just give them proper identifiers because you\'ll need them later.</p>\n\n<p>Then when creating an <em><code>aspx</code></em> page, you will need to mention which master page to use and in which place holder to put what content.</p>\n\n<pre><code>&lt;%@ Page ... master="~/MasterPage.master" ... %&gt;\n\n&lt;asp:Content ID="ContentIdentifier" ContentPlaceholderid="plhMainContent" runat="server"&gt;\n    &lt;%-- More HTML here --%&gt;\n    &lt;%-- Insert web controls here --%&gt;\n&lt;/asp:content&gt;\n</code></pre>\n\n<p>Just make sure you link to the correct master page and that your content refers to the correct place holder.</p>\n\n<p>Master pages save a lot of time and are very powerful. There are tutorials out there, learn the power of place holders and web controls.</p>\n\n<p>Where I work we use master pages and web controls extensively for some major corporations, it gives us an edge when comparing with what other companies can offer.</p>\n'}, {'answer_id': 6750, 'author': 'BinaryMisfit', 'author_id': 146270, 'author_profile': 'https://Stackoverflow.com/users/146270', 'pm_score': 0, 'selected': False, 'text': "<p>In practise I don't often find sites developed not using MasterPages. They allow simple and easy manipulation of site look and feel and also makes navigation elements and shared content pieces a breeze.</p>\n\n<p>ASP.Net 3.5 even allows multiple contentpages and manipulation of header sections across a single master pages.</p>\n\n<p>I rate it as being in the Top 10 tools for Web Developers using ASP.Net.</p>\n\n<p>Even ASP.Net MVC uses MasterPages and all the samples Paul Haack and his crowd put's together makes use of them.</p>\n"}, {'answer_id': 6799, 'author': 'Ciro Villa', 'author_id': 1525924, 'author_profile': 'https://Stackoverflow.com/users/1525924', 'pm_score': 0, 'selected': False, 'text': '<p>I echo other voices in here.  I have used Master Pages in 2.0 and the feature have been great to me. I have been embedding banners, standardized background, captures from Active Dir and other JavaScript features on it for use throughout the app, maintaining the look and feel consistency and without the need to duplicate the effort on multiple pages.  Great feature.</p>\n'}]
['https://Stackoverflow.com/questions/6719', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/133/']