This post originated from an RSS feed registered with .NET Buzz
by Brad Wilson.
Original Post: ASP.NET without .ASPX files
Feed Title: The .NET Guy
Feed URL: /error.aspx?aspxerrorpath=/dotnetguy/Rss.aspx
Feed Description: A personal blog about technology in general, .NET in specific, and when all else fails, the real world.
I've been doing this for a couple years. It's very addicting: I would never choose ASPX files for any new project that I undertook. The maintenance of an ASPX-based web app with a few hundred pages can be astronomical when you need to change core UI elements that end up on many pages.
As you can imagine, custom controls (user or server controls) can help to mitigate this. Getting rid of ASPX pages is the extreme of this idea: eliminate every piece of the UI from being hand coded in HTML; instead, replace EVERYTHING with custom server controls. It's like a refactoring and componentizing system for your UI.
Like Mike, I used a front controller for dispatching requests. I documented the beginnings of that front controller in an article titled Attribute Based URL Dispatching. The one I've used in production is significantly more powerful than I showed.
We drove our UIs dynamically. Displaying an object meant combining the object with context and action (view vs. edit, for example), and letting a factory give you back the renderer. Composite objects can return composite renderers, which makes the whole system pleasantly recursive. Toss in a WebParts like system for the basic layout of the page, and you end up with a system that's remarkably powerful and flexible with just a little bit of code.
The opinions expressed herein are solely those of Brad Wilson, and not meant as an endorsement of or by any other individuals or groups. This syndication is provided for the private, personal use of individuals. Unauthorized commercial reproduction is strictly prohibited.