Welcome to Professional ASP.NET - Chris Love's Official Blog Sign in | Join | Help

Chris Love's Official ASP.NET Blog

Chris Love's Helpful tips, tricks and pragmatic development knowledge for the ASP.NET world.
Add to Technorati Favorites


ASP Insider Follow Me On Twitter
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.

Posted: Tuesday, January 27, 2009 3:22 PM

by Chris Love

Comments

Nick Berardi said:

Hey Chris, I am actually working for a client now, and we are building a proposal system for behind the firewall type application using MVC. There have been some growing pains, mostly because we are using an ever evolving pre-release framework, but over all I see no reason not to use MVC behind the firewall if it really makes sense to do so. I really think that the mentality that bad web practices are okay behind the firewall because Google is never going to parse the code is a bad way of developing internal applications. If it is good for the external web, it is going to be good for the internal web. As an example I just setup a static content server for delivering static content behind the firewall for the company I am currently working for. Because each page request was loading almost 50 different resources including JavaScript, CSS, Images, and HTML content. And browsers can only load two requests at a time, so it was taking forever for this content to download and then render. So taking the idea of a Content Delivery Network behind the firewall helped to reduce the load time by 80%. I believe we just need to start educating internal developers in proper development practices, and stop the drag-and-drop web programming mentality that Microsoft has promoted for 8 years now. Nick
# January 27, 2009 10:51 PM

HoyaBaptiste said:

Chris, PHP is making inroads in the enterprise, too... especially in government. It will only be a matter of time before it is pervasive in commercial industry as well.
# January 28, 2009 7:36 AM

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# January 28, 2009 5:16 PM

Chris Love's Official ASP.NET Blog said:

In my last post I waxed philosophically about the progression of ASP.NET . Today I want to start actually

# January 30, 2009 11:19 PM

ASPInsiders said:

Given that I’ve been focusing a lot on diet and exercise in my personal life, as well as AJAX and JavaScript

# February 3, 2009 10:52 AM

Chris Love's Official ASP.NET Blog said:

Last month I ponder the question of Where Does ASP.NET Belong? This month I want to express my opinion
# February 5, 2009 11:17 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS