ASP.NET MVC 5 with Bootstrap and Knockout.js

Book description

Bring dynamic server-side web content and responsive web design together to build websites that work and display well on any resolution, desktop or mobile. With this practical book, you’ll learn how by combining the ASP.NET MVC server-side language, the Bootstrap front-end framework, and Knockout.js—the JavaScript implementation of the Model-View-ViewModel pattern.

Author Jamie Munro introduces these and other related technologies by having you work with sophisticated web forms. At the end of the book, experienced and aspiring web developers alike will learn how to build a complete shopping cart that demonstrates how these technologies interact with each other in a sleek, dynamic, and responsive web application.

  • Build well-organized, easy-to-maintain web applications by letting ASP.NET MVC 5, Bootstrap, and Knockout.js do the heavy lifting
  • Use ASP.NET MVC 5 to build server-side web applications, interact with a database, and dynamically render HTML
  • Create responsive views with Bootstrap that render on a variety of modern devices; you may never code with CSS again
  • Add Knockout.js to enhance responsive web design with snappy client-side interactions driven by your server-side web application

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Why These Technologies?
    2. What Is a Web Developer?
    3. Who Is This Book For?
    4. Getting Started
    5. Conventions Used in This Book
    6. Using Code Examples
    7. Safari® Books Online
    8. How to Contact Us
    9. Acknowledgements
  2. I. Getting Started
  3. 1. Introduction to MVC
    1. Creating Your First Project
    2. Examining the HomeController
    3. Examining the Views
    4. Understanding the URL Structure
    5. Summary
  4. 2. Introduction to Bootstrap
    1. Examining the Default Menu
    2. A Menu with Drop-Downs and a Search Box
    3. Buttons
    4. Alerts
    5. Themes
    6. Summary
  5. 3. Introduction to Knockout.js
    1. Installing Knockout.js
    2. A Basic Example
    3. What Is MVVM?
    4. Creating ViewModels
    5. Summary
  6. 4. Working with a Database
    1. Introduction to Entity Framework
    2. Code First
    3. Database First
    4. Creating Test Data
    5. Summary
  7. II. Working with Data
  8. 5. Listing, Sorting, and Paging Through Tables
    1. Scaffolding the Author Model
    2. Sorting the Authors
    3. Paging the Authors
    4. Summary
  9. 6. Working with Forms
    1. Integrating Knockout with a Form
    2. Sharing the View and ViewModel
    3. Deleting with a Modal
    4. Empty Table Listings
    5. Summary
  10. 7. Server-Side ViewModels
    1. Why Create Server-Side ViewModels?
    2. The Authors ViewModel
    3. Updating the Authors Listing
    4. Updating the Add/Edit Form
    5. Updating the Delete Modal
    6. Summary
  11. 8. Introduction to Web API
    1. Installing Web API
    2. Updating the List of Authors
    3. Updating the Add/Edit Authors Form
    4. Summary
  12. III. Code Architecture
  13. 9. Creating Global Filters
    1. Authentication Filters 
    2. Authorization Filters
    3. Action Filters
    4. Result Filters
    5. Exception Filters
    6. Global Web API Validation
    7. Automapping with a Result Filter
    8. Web API Error Handling
    9. MVC Error Handling
    10. Summary
  14. 10. Adding Authentication and Authorization
    1. Authentication Overview
    2. Authorization Overview
    3. Implementing an Authentication Filter
    4. Implementing an Authorization Filter
    5. Summary
  15. 11. URL Routing Using Attributes
    1. Attribute Routing Basics
    2. Route Prefixes
    3. Routing Constraints
    4. Summary
  16. 12. Fat Model, Skinny Controller
    1. Separation of Concerns
      1. Controllers
      2. Services
      3. Behaviors
      4. Repositories
      5. Orchestrations
      6. Unit of Work
    2. Services and Behaviors
    3. Summary
  17. IV. A Practical Example
  18. 13. Building a Shopping Cart
    1. Shopping Cart Requirements
    2. The Shopping Cart Project
    3. JavaScript Bundling and Minification
    4. Summary
  19. 14. Building the Data Model
    1. Code-First Models
    2. Defining the DbContext and Initializing Data
    3. The ViewModels
    4. Summary
  20. 15. Implementing the Layout
    1. The Shared Layout
    2. The Cart Summary
    3. The Categories Menu
    4. Summary
  21. 16. Lists of Books
    1. The Home Page
    2. The Featured Books
    3. Filtered Books by Category
    4. Summary
  22. 17. Adding Items to the Cart
    1. The Book Details
    2. Custom Components and Custom Bindings
    3. Saving the Cart Item
    4. Summary
  23. 18. Updating and Deleting Cart Items
    1. The Cart Details
    2. Knockout for the Cart Details
    3. Completing the Shopping Cart
    4. Summary
  24. Index

Product information

  • Title: ASP.NET MVC 5 with Bootstrap and Knockout.js
  • Author(s): Jamie Munro
  • Release date: May 2015
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491914403