Chapter 22ASP.NET MVC

  • Understanding the Model-View-Controller design pattern
  • Developing ASP.NET MVC applications
  • Designing URL routes
  • Validating user input
  • Integrating with jQuery

When Microsoft introduced the first version of the .NET Framework in 2002, it added a new abstraction for the development of web applications called ASP.NET Web Forms. Where traditional Active Server Pages (ASP) had up until this point operated like simple templates containing a mix of HTML markup and server-side code, Web Forms was designed to bring the web application development experience closer to the desktop application programming model. This model involves dragging components from a toolbox onto a design surface, and then configuring those components by setting property values and writing code to handle specific events.

Although Web Forms has been and continues to be successful, it is not without criticism. Without strong discipline it is easy for business logic and data-access concerns to creep into the user interface, making it hard to test without sitting in front of a browser. It heavily abstracts away the stateless request/response nature of the web, which can make it frustrating to debug. It relies heavily on controls rendering their own HTML markup, which can make it difficult to control the final output of each page.

In 2004, the release of a simple open source framework for building web applications called Ruby on Rails heralded a renewed interest in an ...

Get Professional Visual Studio 2013 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.