Where Does ASP.NET Belong? And What ASP.NET Should I Use?

It really does not seem like that long ago I found the Beta 1 bits of ASP.NET 1.0 and started tinkering and created the first of several hundred ASP.NET sites. That was May 2001 and everything I had created up to that point was in Classic ASP, at the time I think I was managing around 25 sites for various clients. I had just finished creating a timesheet application that required some mildly sophisticated paging and sorting routines for the timesheet grid. I think I spent about 8 fill days creating and testing that code to make sure all the cases were covered. I decided to see how long it would take to get that same routine working with a DataGrid. I had about 95% running in about 20 minutes!!! I was hooked. Every site I have done since then has been ASP.NET WebForms, which like I said is around 300 believe it or not.

Fast forward about 8 years and there have been so many advances in the ASP.NET world, but something I really think has gotten lost by many ASP.NET developers is an intimate knowledge of HTML, CSS and JavaScript. ASP.NET was originally designed to make the transition for desktop developers to the web platform very easy, meaning make it programmatically close to building WinForm applications. This is why we have Web Controls and ViewState. We also have a very rapid development framework for the first 95% of any application we might need to build. That last 5% has often been a very frustrating experience for many of us.

Over the past couple of years I have felt like I was pulling out my hair trying to find ways to make things I saw in other sites work in the ASP.NET WebForms model. I started realizing there are many things about the WebForms model that seemed to get in the way. One of the reasons is HTML ids are created by composites of the control tree. With ASP.NET AJAX we now have numerous script references. Inline styles emitted from the web controls and do not forget the ViewState. Since last summer I have been on a quest to get back a solid knowledge of HTML, CSS and JavaScript.

Most of the sites I have created have been public sites, meaning outside the firewall. This means I have to compete against sites of all flavors for market share. I also find that many of the competing sites are done with what I consider to be lower technologies, often in PHP these days. Their sites are lean and fast, plus they get them to market extremely fast. behind the firewall I just have not seen PHP in play, but a world dominated by ASP.NET WebForms or Java Server Pages. Without a doubt I truly believe ASP.NET is by far the best platform to build the best web applications, but I wont go into a rant about that today.

So where am I going? Well I really want to start working on showing how to leverage ASP.NET to build sites not bound to the WebForms model. In fact I am going to start calling ASP.NET WebForms Ompa Loopa code.

In October of 2007 Scott Guthrie demonstrated ASP.NET MVC for the first time. At first glance MVC reminded me of Classic ASP and I thought are we going backwards? The answer is no. This is a giant leap forward for ASP.NET and I personally think the technology to use for public web sites. Those where performance and search engine optimization is key to success. Is MVC the only way to achieve these goals? no.

What else can we use? Well you can do the same thing you always have, just remove the single form tag and do not use Web Controls or ViewState. This means you can more rapidly port your existing application from the WebForm model, without having to completely rewrite the entire application and learn MVC. Ultimately you would get something very close to MVC, where the UI is really separated from the business layers of the application.

If you were to start a new project today and ask me to recommend how to proceed I would ask one question, 'Is this application going to be behind the firewall only? Or will it be available to the public?' For behind the firewall stick with WebForms, you will get things up and running faster because that is what you know. If you are going for a public facing site then get into MVC.

So I hope to start creating more and more posts on these topics over the coming months. I know I have learned a lot since this past summer and I can not wait to share what I have learned.

Share This Article With Your Friends!

Googles Ads Facebook Pixel Bing Pixel LinkedIn Pixel