ASP.NET compared to Java web apps

· Read in about 2 min · (271 words) ·

For the most part, I find ASP.NET far more easier to use than Java. But the ONE BIG THING where I’ve found ASP.NET sorely lacking is in the support for page templates.

Page templates, if you need to brush up, allow you to define common layout and contents for a web site. Furthermore, once defined, its easy to change the layout and or move your default items around the place.

Basically, what you need is to be able to define a template page with the different areas (header, left pane, main content, footer etc). So the template page controls what is shown where. In addition, you also define the default content for all these areas.

Now each page in the application just overrides the content for the main area (assuming that the defaults are fine for the rest of it). WOW!!!

Java’s had this quite some time - Jakarta Struts has something called Tiles which does exactly this.

For .NET, as I mentioned, the need’s going to be fulfilled with v2.0 of ASP.NET. Meanwhile, if you feel the idea’s great and there’s no point in waiting for v2.0, release, do take a look at MasterPage as control gallery. Do note that since the team has released this control, there’s a good chance that most of the features will end up in 2.0.

There are a few shortcomings of the control though - you’ll get a hang of them if you read the posts. Paul Wilson has a version which overcomes these - and best of all, he releases the control with source :). You can find it here.