Things that you did not know about Master pages in ASP.NET
Fer unknown facts about Master pages in ASP.NET
One cannot cache a Master Page with the OutputCache directive.
- One cannot apply a theme to a Master Page.
- The content page does not contain any of the standard opening and closing XHTML tags.All these tags are contained in the Master Page.
- You can nest ContentPlaceHolder controls in a Master Page. If you do this, you have the option of overriding greater or smaller areas of content in the Master Page.
- You don’t need to associate a Content control with every ContentPlaceHolder control contained in a Master Page. You can provide default content in a ContentPlaceHolder control, and the default content appears unless it is overridden in a particular content page.
- Relative URLs used by ASP.NET controls in a Master Page are automatically reinterpreted relative to the Master Page. This process of reinterpretation is called rebasing. Only ASP.NET control properties decorated with the UrlProperty attribute are rebased.
- If you use a relative URL with an ASP.NET control, the URL is interpreted relative to the Master Page. For example, suppose that you add the following ASP.NET Image control to a Master Page:
<asp:Image ImageUrl="Picture.gif" Runat="Server" />
The ImageUrl property contains a relative URL. If the Master Page is in a folder named MasterPages, the URL is interpreted like this:
/MasterPages/Picture.gif