Tuesday, December 20, 2011

ASP.NET Web Pages and QUnit


Phil Haack has mentioned Web Pages a few times recently, so I thought it was worth posting here. It's essentially designed to take advantage of Razor's more concise (and generally more fun to use) syntax, and make it easy and appealing for people who want to make quick and easy web pages with a bit of server-side scripting thrown in. But who don't want to have to build a full MVC app.

In other words, to give ASP.NET the sort of quick and easy flexible feel of PHP. You can write full-blown OO PHP apps, but most people start at least with the quick and dirty option.

At first glance on that basis it's hard to see where Web Pages would fit in for me, after all, I am building full-blown MVC applications, and you generally wouldn't want to mix and match Web Pages and Controller routing within a single solution - it would make routing ambiguous.

On the other hand, Haack points out a very nice usage here, for testing using QUnit. The point is, controller actions are a bit redundant in the frontend script testing scenario, so why use them just for routing's sake?

He points out how annoyingly generic the name 'Web Pages' is too. He's right.