Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Master Pages in ASP.NET 2.0 simply a declarative approach?

Most of the time, the articles mentioned in the .NET Insight newsletter that Fawcette sends out don't attract my attention much. Today's had a few articles on Master Pages in ASP.NET 2.0 so I decided to give them a look since I've been somewhat curious about how Master Pages are going to work.

After reading this the two articles though, I didn't get the feeling that Master Pages actually allow you to do anything you can't already do with ASP.NET if you know how to make your base class for your page inherit from a custom class rather than System.Web.UI.Page (although your custom class inherits from Page). We've had the PlaceHolder control in ASP.NET for a long time already, too (since v1.0?).

What it appears to me, is that Master Pages are simply a declarative way to do what we're already doing with ASP.NET page templates. We've got an @Master directive now, and <asp:contentplaceholder> controls. Neither of the articles I read though, did a very good job of explaining why you'd want to migrate your existing page template code to Master Pages. Is there a benefit of increased flexibility or something? I guess I'm missing the point so far.

2 Comments

  • ehh... well theres been versions of masterpages floating around almost since .net 1.0 was released... written by different people etc.



    For me, I wanted something that I should ahve been able to achieve with a page base class and inheritance.



    IIRC, you can inherit a page, but the ui inheritance is rather dismal or non-existant. Also, masterpages are designer ready (for some this is a big deal)



    Its a lot easier to specify a master page template and setup regions than use the base pages etc.



  • PS... Thanks to crap like this, ASP.NET programmers are going to end up so niche-ey and proprietary it'll be COBOL all over again.



    $.02

Comments have been disabled for this content.