ASP.NET is a very functional framework for developing web
applications. Creating an object-oriented solution is harder to do so because
of the coding effort involved with doing so. This coding effort means creating
a custom page or user control class that drives the ASP.NET page.
You may wonder why you would want to do all that work to get
around a few complicated problems. The biggest benefit that I have found is
that with this extra work, it is possible to unit test ASP.NET pages, which is
a huge benefit to ensure that application logic is correct. You can ensure that
controls are shown/hidden, that the data displays correctly, and test many of
the other visual mechanisms as well. The drawbacks to this approach are the
strong coupling between the ASP.NET page and the custom page object and the
level of coding effort involved.
There are some challenges when working with ASP.NET objects that
I will explain in detail later on. Before we start looking at the problem and
the solution, an understanding of some of the capabilities is needed.