Andrew Stopford's Weblog

poobah

News

Articles

Family

Old Blogs

Webforms do we need them

I have posted about this before and was pointed at the MonoRail project (a sort of Ruby on Rails project for .NET run on the Castle Project). I will admit I have yet to look in any great depth at MonoRail but I have long felt the need for a new model to web programming in ASP.NET that follows MVC in a far more isolated fashion than ASPX allows.

ASPX is not unit testable, its so tightly bound that you have no way of unit testing aspx code behind. ASPX is not testable in the same fashion as all your other code,  I need a far more isolated model.

ASPX does not give me render control, even the revent work does not give me complete control over what is ouput. When we look at MonoRail we can see that you can append a template engine and have complete control over your view, Hammet puts it well in this post.

ASPX and viewstate, done right it can be your friend, done wrong and its a page load increasing monster. I want something far more manageable.

Update: A comment quite rightly states you can unit test code behind using NUnitASPX, I however want a model thats more like all my other testing and does not require a web server etc to fire page events.

Comments

BigJim in STL said:

With regards to your statement

"ASPX is not unit testable"

Have you not tried NUnitASP? I use it to unit test all of my aspx pages - including the code-behind, data retrieval logic, etc. Give it a look, you might be pleasantly surprised!
# September 27, 2005 9:34 AM

Brian said:

I couldn't agree more with you Andrew. WebForms have too many limitations when you look at how apps are built on RoR, Django and related toolkits. Unfortunately, Microsoft don't provide proper guidance on building maintainable ASP.NET applications. It would be contrary to the 'no code' datagrid/dataset approach.

I build my apps with server controls and an HttpHandler framework derived from Brad Wilson's approach at http://www.dotnetdevs.com/articles/AttributeBasedURLDispatch.aspx. Deployment is also a lot easier with fewer dependencies to manage.
# September 27, 2005 11:32 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)