Master pages NOW!
Many
people have heard about the master pages that will be available in Whidbey.
I’ve already developed an internal web site using them, and I must say, they
rock!
Some cool features of master pages:
- You can cascade the master pages, so you have a
BaseMasterPage, with your basic template, and then you have sub-master pages
that inherit the layout of the BaseMasterPage, and add any custom
layout. This allows you to make change oh so easily. - Each master page and sub master page gets its
own code behind. So not only can we have our own BasePage classes like Brendan
and Raymond have been talking about, but now we can move some of the
presentation logic into the appropriate master page. - Full intellisense support in the html view (in
VS2005). This is awesome, if you are designing a sub-master page, you
can reference items from the parent master page in the html view of the page.
VS2005 has improved their intellisense dramatically over 2003. - You can change what master page you are using
programmatically, and you can specify a different master page for different
browsers, which is auto-detected by asp.net.
The funny thing is, is that this behavior can be
mimicked right now using UserControls. Paul Wilson has
a post about how to implement this, its a great
read.
Anonymous said,
Wrote on February 6, 2005 @ 9:59 am
Yeah, I am definately looking forward to this in 2005. I actually looked into the same thing Paul talks about, but knew that master pages were coming in 2005 so never went anywhere with it. Master pages will change how the BasePage implementation that Brendan and I have been talking about will be designed and function.
breichelt said,
Wrote on February 7, 2005 @ 8:33 am
Use Master pages in v1.1 - level 200
breichelt said,
Wrote on February 17, 2005 @ 10:48 am
<p><a href="http://authors.aspalliance.com/PaulWilson/Articles/?id=14">Quite</a> a few <a href="http://www.codeproject.com/aspnet/page_templates.asp">people</a> have <a href="http://codebetter.com/blogs/ben.reichelt/archive/2005/02/04/50549.aspx">created</a> their own <a href="http://www.codeproject.com/aspnet/Frame_Work_Design.asp">solutions</a> to the one of the most famous shortcomings of current versions of ASP.NET: the lack of master pages. It’s notoriously arduous to <i>enclose</i> content into a designated area of a page that has programmatical functionality elsewhere.</p>
<p>I am not very keen on the <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/aspnet-masterpages.asp">ASP.NET 2.0</a> design, either. That requires the developer to write specific server control definitions and references here and there. What I want to accomplish is to make the master paging as easy as possible (of course, easy when excluding the implementation of the master paging system).</p>