Chapter 4. The view in depth

 

This chapter covers

  • Rendering views
  • Techniques for working with ViewData
  • Error reporting
  • Handling complexity

Views have long been abused in the Microsoft web application space. In Classic ASP, and in IDC/HTX before that, the view was the primary programming tool for the Microsoft-centric developer. Using the Server Page pattern, developers used IDC and ASP pages as transaction scripts to perform a single operation and render a screen. Each page has logic, behavior, and a UI. ASP.NET 1.0 sought to separate logic from the UI rendering to make applications easier to maintain and extend, because having logic intermixed with screen rendering had often proved to be an unworkable solution for many teams. Although it certainly was possible for teams to separate the concerns in their applications, Microsoft had provided no guidance on how to do so, and most samples and demo applications encouraged the intermingling of concerns.

4.1. How ASP.NET MVC views differ from Web Forms

4.2. Folder structure and view basics

4.3. Overview of view basics

4.4. Leveraging the view to create dynamic screens

4.5. Summary