Preface

In this series of posts I will be talking about and demonstrating some concepts on how to make web forms programming more elegant. With ASP.NET web forms, sometimes things can get quite messy. This is mostly because ASP.NET wants to hide that you are programming over HTTP. It wants you, the developer, to take on the mindset of a desktop application developer. The reason it works this way, is because when ASP.NET was conceived most of the development was still done for the desktop, and they wanted to attract all the devs to the web by emulating their trusted and known environment.

While this is sometimes handy, I don’t really like it. It distracts you of what is really going on. As long as everything is working nicely and you don’t need to dive deep into the development stack, this works just fine, and is even comfortable. However once things get really complicated you often can’t see what’s really going on. If you have ever done a project apart from Hello World, you’ll know for a fact that that things will get complicated.

Because ASP.NET makes you feel like you’re developing a desktop application, it’ll take care of the client-side (in its own mysterious way). This was all fine a few years ago, when a web application (or website) was nothing more then synchronous request-response with here and there some auto-generated scripts. However, since AJAX came along, more and more people are schooled as pure web developers, and they want full control over what they’re doing.

People started using JavaScript libraries, such as Prototype, jQuery, extJS and so on. Even Microsoft jumped on this and they created their very own Ajax-framework. However, jQuery is by far the most popular, which Microsoft did in fact realize.

Nowadays a more elegant (in my opinion) version of ASP.NET exists: ASP.NET MVC. It fully incorporates design patterns, unit testing, clean code, unobtrusive JavaScript, etc.

When working in the industry though, you hardly ever get the chance to do “File > New Project”, and pick ASP.NET MVC. This can be for various reasons (people are not accustomed to it, you have running projects, etc.). So sometimes it’s necessary to continue with good old web forms.

But hey, the good part of web forms is that it’s completely customizable, so don’t blame bad code on ASP.NET, you can definitely write elegant web applications in ASP.NET.

In these series I will show several concepts of how to make clean AJAX enabled ASP.NET web forms applications with jQuery.

I will be focusing on using the power of .NET without all the overhead that web forms actually add together with pure web technology such as HTML 5, JavaScript and CSS 2/3. So don’t expect any server controls, view states, update panels, etc.

Comments are closed.