Published:
Monday, September 15, 2008
The basics of building a site using ASP NET are straight forward and made easy with tools such as Visual Studio. ASP.NET web forms have come a long way since they were first introduced with the .NET framework, however we have come to discover that Web Form are problematic and regularly under-perform.
Web Forms have some severe set backs, most notably is that we are limited to a single Form tag on a page which requires the entire contents of the page to be posted back and processed by the server, even if the only change is the selection of an item in a drop down menu (where the drop down menu needs to auto-postback to allow us to perform some other kind of logic). This is a HUGE disadvantage as the developer can not process parts of the page in the same manner we would have using normal HTML elements and multiple form tags which enable partial-page processing.
Another major disadvantage is VIEWSTATE, Microsoft's answer to page state management. Viewstate stores just that, the state of elements on the page, so that the developer no longer has to specifically handle this on a postback. However VIEWSTATE bloats the page, often enormously, and becomes a major problem when a page contains lots of controls and data, causing huge performance lags as all this data must be passed back and forth to the server on each postback which is only further impacted by the "single form tag" problem.
Fortunately Micorsoft has recognized these disadvantages and has introduced the
ASP.NET MVC Framework as the replacement for the Web Forms model we have been working with for many years now. MVC moves us back to the familiarity of typical HTML forms processing and encourages cleaner, more testable, code by following the Model View Controller architecture construct. This facilitates code creation that can achieve 100% code coverage via automated tests, something that Web Forms made much harder.