Web Forms, MVC and Web Pages! Oh my!
Learning .NET, C# or any of the Microsoft development environments can seem a bit daunting when you are just getting started in the development world. You’ll receive a ton of advice about what you should be using and people will often recommend the latest and greatest tools that frankly, you might not be ready for.
In this blog post, I’ll review over the three main ASP.NET web development technologies to help broadly cover what each of them do and which one might be best for you to get started with.
Web Pages and Web Sites are part of the newest branch of Microsoft’s development technologies that is aimed (but not limited by any means) at making web sites and web applications very easy to build. They provide an easy-to-learn and highly scalable platform to build application that range from introductory level learning projects to fully-featured applications.
Excellent for beginners, small learning curve, great for small and larger applications
Web Pages serves a distinct purpose in being an easily accessible (meaning that you don’t need an overly large amount of expertise to use it) platform for users to create very simple web sites and basic applications. Microsoft has continued to show a commitment in this area with the continued release and developments of the WebMatrix platform that houses Web Pages and a few other areas. It could be thought of as a hybrid between the two other major development paradigms (which are covered further down in this post) by using the Razor View engine that was popularized by ASP.NET MVC (and will provide the flexibility of MVC applications) and the concept of a “Page” which is a trait of Web Forms.
Web Pages appears that it will be around as long as WebMatrix continues to be a viable platform, but as of now it doesn’t really show any signs of stopping and with the release of WebMatrix 3, it’ll continue to grow rich in features and likely in popularity.
Web Forms are a classic staple of .NET development that promotes rapid-development and features an easy drag-and-drop method for developing applications that range from small to enterprise.
Small-medium learning curve, supports rapid development, great for applications of all sizes, well-supported and very mature.
When developers often think of ASP.NET, they associate it with Web Forms. Web Forms are the web development-friendly version of Microsoft’s traditional Windows Forms desktop applications and I would venture to say the most widespread of all of Microsoft's development technologies (and by far the most mature).
Web Forms can be considered a much more “professional” platform and environment than its younger Web Pages brethren. It features a vast library controls that can be easily integrated (and event drag-and-dropped onto your pages) which provides an easy method for rapidly developing both web sites and fully-featured web applications. It doesn't have a terribly large learning curve and by being such a mature product, the amount of resources on basically any topic on it are endless.
Web Forms will basically be around as long as the .NET environment exists, as not only are improvements continuing to be made for it, but it has been around for so long that you couldn't count the number of legacy applications that rely on it. Its popularity has begun to wane recently with the resurgence of ASP.NET MVC, however it is still a standard for .NET Web Development and doesn't look like it will be going anywhere for a long, long time.
ASP.NET MVC is Microsoft's most recently major development technology and it has a bit of a higher learning curve than its Web Forms or Web Pages brethren. However, it provides a higher level of test-ability, inherent separation of concerns and the ability to build and scale applications of any size.
ASP.NET MVC is Microsoft's newest fully-featured development paradigm which takes a different approach to development than its Web Forms predecessor. It provides a larger level of control over applications than Web Forms and an improved “separation of concerns” within applications. Despite this, it is not meant to replace Web Forms by any means but to simply provide an alternative design pattern to model and design your applications with.
The Model View Control paradigm has been around for a long time and has been used within many different environments and languages (such as Ruby) and it is basically made to suit the web (as it is designed to be stateless unlike stateful Web Forms). Its learning curve is a bit higher than that of Web Forms, due to the lack of “Controls” and having to handle things like events in a more manual fashion (which does allow for more flexibility and control).
It seems like new versions of MVC are released with every few flips of the calendar and Microsoft doesn't show any signs of slowing development in the MVC direction as it continues to grow in popularity. Much like Web Forms, it will likely be around as long as the .NET environment exists.
What Should I Use?
A common question related to this topic is "Which one is best?" and the answer is always either "There is no best." or "It depends".
Each of these options were designed for specific purposes and uses. Web Sites and Web Pages were made to allow those with a little to moderate knowledge of Web Development to be able to create basic Web Sites and Pages (and web applications) using ASP.NET.
Web Applications is a bit broader term that encompasses Web Forms and ASP.NET MVC and is geared for larger fully-functional (and scalable) applications (but it can also be used to create Web Sites). I understand how this can easily be confusing as it seems that all of them can basically do the same thing and that is simply because they can. They are just different tools (some larger than others) to ultimately accomplish the same thing.
I would highly recommend working with each of them and determining which best suits your needs and your current skill level. Check out the following links from ASP.NET to get started with each of these different technologies :