O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pro ASP.NET MVC 5, Fifth Edition

Book Description

The ASP.NET MVC 5 Framework is the latest evolution of Microsoft's ASP.NET web platform. It provides a high-productivity programming model that promotes cleaner code architecture, test-driven development, and powerful extensibility, combined with all the benefits of ASP.NET.

ASP.NET MVC 5 contains a number of advances over previous versions, including the ability to define routes using C# attributes and the ability to override filters. The user experience of building MVC applications has also been substantially improved. The new, more tightly integrated, Visual Studio 2013 IDE has been created specifically with MVC application development in mind and provides a full suite of tools to improve development times and assist in reporting, debugging and deploying your code.

The popular Bootstrap JavaScript library has also now been included natively within MVC 5 providing you, the developer, with a wider range of multi-platform CSS and HTML5 options than ever before without the penalty of having to load-in third party libraries.

What you'll learn

  • Gain a solid architectural understanding of ASP.NET MVC 5

  • Explore the entire ASP.NET MVC Framework as a cohesive whole

  • Learn what's new in version 5 and how best to apply these new features to your own work

  • See how MVC and test-driven development work in action

  • Capitalize on your existing knowledge quickly and easily through comparison of features in classic ASP.NET to those in ASP.NET MV

  • Who this book is for

    This book is for web developers with a basic knowledge of ASP.NET and C#who want, or need, to start using the new ASP.NET MVC 5 Framework.

    Table of Contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Author
    6. About the Technical Reviewer
    7. CHAPTER 1: Putting ASP.NET MVC in Context
      1. Understanding the History of ASP.NET
      2. Web Development Today
      3. Key Benefits of ASP.NET MVC
      4. What Do I Need to Know?
      5. What Is the Structure of This Book?
      6. What’s New in this Edition?
      7. Where Can I Get the Example Code?
      8. What Software Do I Need for This Book?
      9. Credits
      10. Summary
    8. CHAPTER 2: Your First MVC Application
      1. Preparing Visual Studio
      2. Creating a New ASP.NET MVC Project
      3. Rendering Web Pages
      4. Creating a Simple Data-Entry Application
      5. Summary
    9. CHAPTER 3: The MVC Pattern
      1. The History of MVC
      2. Understanding the MVC Pattern
      3. Building Loosely Coupled Components
      4. Getting Started with Automated Testing
      5. Summary
    10. CHAPTER 4: Essential Language Features
      1. Preparing the Example Project
      2. Using Automatically Implemented Properties
      3. Using Object and Collection Initializers
      4. Using Extension Methods
      5. Using Lambda Expressions
      6. Using Automatic Type Inference
      7. Using Anonymous Types
      8. Performing Language Integrated Queries
      9. Using Async Methods
      10. Summary
    11. CHAPTER 5: Working with Razor
      1. Preparing the Example Project
      2. Working with the Model Object
      3. Working with Layouts
      4. Using Razor Expressions
      5. Summary
    12. CHAPTER 6: Essential Tools for MVC
      1. Preparing the Example Project
      2. Using Ninject
      3. Unit Testing with Visual Studio
      4. Using Moq
      5. Summary
    13. CHAPTER 7: SportsStore: A Real Application
      1. Getting Started
      2. Starting the Domain Model
      3. Displaying a List of Products
      4. Preparing a Database
      5. Adding Pagination
      6. Styling the Content
      7. Summary
    14. CHAPTER 8: SportsStore: Navigation
      1. Adding Navigation Controls
      2. Building the Shopping Cart
      3. Summary
    15. CHAPTER 9: SportsStore: Completing the Cart
      1. Using Model Binding
      2. Completing the Cart
      3. Submitting Orders
      4. Summary
    16. CHAPTER 10: SportsStore: Mobile
      1. Putting Mobile Web Development in Context
      2. Using Responsive Design
      3. Creating Mobile Specific Content
      4. Summary
    17. CHAPTER 11: SportsStore: Administration
      1. Adding Catalog Management
      2. Summary
    18. CHAPTER 12: SportsStore: Security & Finishing Touches
      1. Securing the Administration Controller
      2. Image Uploads
      3. Summary
    19. CHAPTER 13: Deployment
      1. Preparing Windows Azure
      2. Deploying the Application
      3. Summary
    20. CHAPTER 14: Overview of MVC Projects
      1. Working with Visual Studio MVC Projects
      2. Debugging MVC Applications
      3. Using Browser Link
      4. Summary
    21. CHAPTER 15: URL Routing
      1. Preparing the Example Project
      2. Introducing URL Patterns
      3. Creating and Registering a Simple Route
      4. Defining Default Values
      5. Using Static URL Segments
      6. Defining Custom Segment Variables
      7. Constraining Routes
      8. Using Attribute Routing
      9. Summary
    22. CHAPTER 16: Advanced Routing Features
      1. Preparing the Example Project
      2. Generating Outgoing URLs in Views
      3. Customizing the Routing System
      4. Working with Areas
      5. Routing Requests for Disk Files
      6. Bypassing the Routing System
      7. URL Schema Best Practices
      8. Summary
    23. CHAPTER 17: Controllers and Actions
      1. Preparing the Example Project
      2. Introducing the Controller
      3. Receiving Request Data
      4. Producing Output
      5. Summary
    24. CHAPTER 18: Filters
      1. Preparing the Example Project
      2. Using Filters
      3. Using Authorization Filters
      4. Using Authentication Filters
      5. Using Exception Filters
      6. Using Action Filters
      7. Using Result Filters
      8. Using Other Filter Features
      9. Summary
    25. CHAPTER 19: Controller Extensibility
      1. Preparing the Example Project
      2. Creating a Custom Controller Factory
      3. Working with the Built-in Controller Factory
      4. Creating a Custom Action Invoker
      5. Using the Built-in Action Invoker
      6. Improving Performance with Specialized Controllers
      7. Summary
    26. CHAPTER 20: Views
      1. Creating a Custom View Engine
      2. Working with the Razor Engine
      3. Adding Dynamic Content to a Razor View
      4. Summary
    27. CHAPTER 21: Helper Methods
      1. Preparing the Example Project
      2. Creating Custom Helper Methods
      3. Using the Built-In Form Helper Methods
      4. Summary
    28. CHAPTER 22: Templated Helper Methods
      1. Preparing the Example Project
      2. Using Templated Helper Methods
      3. Using Model Metadata
      4. Customizing the Templated View Helper System
      5. Summary
    29. CHAPTER 23: URL and Ajax Helper Methods
      1. Preparing the Example Project
      2. Creating Basic Links and URLs
      3. Using MVC Unobtrusive Ajax
      4. Creating an Unobtrusive Ajax Form
      5. Setting Ajax Options
      6. Creating Ajax Links
      7. Working with Ajax Callbacks
      8. Working with JSON
      9. Summary
    30. CHAPTER 24: Model Binding
      1. Preparing the Example Project
      2. Understanding Model Binding
      3. Using the Default Model Binder
      4. Manually Invoking Model Binding
      5. Customizing the Model Binding System
      6. Summary
    31. CHAPTER 25: Model Validation
      1. Preparing the Example Project
      2. Explicitly Validating a Model
      3. Displaying Validation Messages
      4. Using Alternative Validation Techniques
      5. Performing Client-Side Validation
      6. Performing Remote Validation
      7. Summary
    32. CHAPTER 26: Bundles
      1. Preparing the Example Application
      2. Profiling Script and Style Sheet Loading
      3. Using Script and Style Bundles
      4. Summary
    33. CHAPTER 27: Web API and Single-page Applications
      1. Understanding Single-page Applications
      2. Preparing the Example Application
      3. Using Web API
      4. Understanding How the API Controller Works
      5. Using Knockout for Single-page Applications
      6. Completing the Application
      7. Summary
    34. Index