Trang Web hiện đặt quảng cáo để có kinh phí duy trì hoạt động, mong Quý Bạn đọc thông cảm. Sách ebook được sưu tầm từ Internet, Bản quyền sách thuộc về Tác giả & Nhà xuất bản

Programming ASP.NET MVC 4

Tác giả: Jess Chadwick - Todd Snyder - Hrusikesh Panda

Get up and running with ASP.NET MVC 4, and learn how to build modern server-side web applications. This guide helps you understand how the framework performs, and shows you how to use various features to solve many real-world development scenarios you’re likely to face. In the process, you’ll learn how to work with HTML, JavaScript, the Entity Framework, and other web technologies.

You’ll start by learning core concepts such as the Model-View-Controller architectural pattern, and then work your way toward advanced topics. The authors demonstrate ASP.NET MVC 4 best practices and techniques by building a sample online auction site (“EBuy”) throughout the book.

  • Learn the similarities between ASP.NET MVC 4 and Web Forms
  • Use Entity Framework to create and maintain an application database
  • Create rich web applications, using jQuery for client-side development
  • Incorporate AJAX techniques into your web applications
  • Learn how to create and expose ASP.NET Web API services
  • Deliver a rich and consistent experience for mobile devices
  • Apply techniques for error handling, automated testing, and build automation
  • Use various options to deploy your ASP.NET MVC 4 application

Table of Contents

  1. Up and Running

    1. Chapter 1 Fundamentals of ASP.NET MVC

      1. Microsoft’s Web Development Platforms
      2. The Model-View-Controller Architecture
      3. What’s New in ASP.NET MVC 4?
      4. Introduction to EBuy
      5. Installing ASP.NET MVC
      6. Creating an ASP.NET MVC Application
      7. Routing
      8. Controllers
      9. Views
      10. Models
      11. Putting It All Together
      12. Authentication
      13. Summary
    2. Chapter 2 ASP.NET MVC for Web Forms Developers

      1. It’s All Just ASP.NET
      2. More Differences than Similarities
      3. Authoring ASP.NET MVC Views Using Web Forms Syntax
      4. Summary
    3. Chapter 3 Working with Data

      1. Building a Form
      2. Handling Form Posts
      3. Saving Data to a Database
      4. Validating Data
      5. Summary
    4. Chapter 4 Client-Side Development

      1. Working with JavaScript
      2. Selectors
      3. Responding to Events
      4. DOM Manipulation
      5. AJAX
      6. Client-Side Validation
      7. Summary
  2. Going to the Next Level

    1. Chapter 5 Web Application Architecture

      1. The Model-View-Controller Pattern
      2. Architecting a Web Application
      3. Design Principles
      4. Don’t Repeat Yourself
      5. Summary
    2. Chapter 6 Enhancing Your Site with AJAX

      1. Partial Rendering
      2. JavaScript Rendering
      3. Reusing Logic Across AJAX and Non-AJAX Requests
      4. Sending Data to the Server
      5. Cross-Domain AJAX
      6. Summary
    3. Chapter 7 The ASP.NET Web API

      1. Building a Data Service
      2. Paging and Querying Data
      3. Exception Handling
      4. Media Formatters
      5. Summary
    4. Chapter 8 Advanced Data

      1. Data Access Patterns
      2. Entity Framework Overview
      3. Building a Data Access Layer
      4. Sorting, Filtering, and Paging Data
      5. Summary
    5. Chapter 9 Security

      1. Building Secure Web Applications
      2. Securing an Application
      3. Guarding Against Attacks
      4. Summary
    6. Chapter 10 Mobile Web Development

      1. ASP.NET MVC 4 Mobile Features
      2. Making Your Application Mobile Friendly
      3. Improving Mobile Experience
      4. Adaptive Rendering
      5. Creating a New Mobile Application from Scratch
      6. Summary
  3. Going Above and Beyond

    1. Chapter 11 Parallel, Asynchronous, and Real-Time Data Operations

      1. Asynchronous Controllers
      2. Real-Time Asynchronous Communication
      3. Summary
    2. Chapter 12 Caching

      1. Types of Caching
      2. Server-Side Caching Techniques
      3. Client-Side Caching Techniques
      4. Summary
    3. Chapter 13 Client-Side Optimization Techniques

      1. Anatomy of a Page
      2. Best Practices
      3. Measuring Client-Side Performance
      4. Putting ASP.NET MVC to Work
      5. Summary
    4. Chapter 14 Advanced Routing

      1. Wayfinding
      2. URLs and SEO
      3. Building Routes
      4. Route Constraints
      5. Attribute-Based Routing
      6. Extending Routing
      7. Summary
    5. Chapter 15 Reusable UI Components

      1. What ASP.NET MVC Offers out of the Box
      2. Taking It a Step Further
      3. Unit Testing Razor Views
      4. Summary
  4. Quality Control

    1. Chapter 16 Logging

      1. Error Handling in ASP.NET MVC
      2. Logging and Tracing
      3. Summary
    2. Chapter 17 Automated Testing

      1. The Semantics of Testing
      2. Levels of Automated Testing
      3. What Is an Automated Test Project?
      4. Testing an ASP.NET MVC Application
      5. Code Coverage
      6. Developing Testable Code
      7. Summary
    3. Chapter 18 Build Automation

      1. Creating Build Scripts
      2. Automating the Build
      3. Continuous Integration
      4. Summary
  5. Going Live

    1. Chapter 19 Deployment

      1. What Needs to Be Deployed
      2. Deploying to Internet Information Server
      3. Deploying to Windows Azure
      4. Summary
  6. Appendixes

    1. Appendix ASP.NET MVC and Web Forms Integration

      1. Choosing Between ASP.NET MVC and ASP.NET Web Forms
      2. Transitioning a Web Forms Site to ASP.NET MVC
      3. Integrating Web Forms and ASP.NET MVC Functionality
      4. Summary
    2. Appendix Leveraging NuGet as a Platform

      1. Installing the NuGet Command-Line Tool
      2. Creating NuGet Packages
      3. The Anatomy of a NuGet Package
      4. Types of NuGet Packages
      5. Tool Packages
      6. Sharing Your NuGet Packages
      7. Tips, Tricks, and Pitfalls
      8. Summary
    3. Appendix Best Practices

      1. Use the NuGet Package Manager to Manage Dependencies
      2. Depend on Abstractions
      3. Avoid the New Keyword
      4. Avoid Referring to HttpContext Directly (Use HttpContextBase)
      5. Avoid “Magic Strings”
      6. Prefer Models over ViewData
      7. Do Not Write HTML in “Backend” Code
      8. Do Not Perform Business Logic in Views
      9. Consolidate Commonly Used View Snippets with Helper Methods
      10. Prefer Presentation Models over Direct Usage of Business Objects
      11. Encapsulate if Statements with HTML Helpers in Views
      12. Prefer Explicit View Names
      13. Prefer Parameter Objects over Long Lists of Parameters
      14. Encapsulate Shared/Common Functionality, Logic, and Data with Action Filters or Child Actions (Html.RenderAction)
      15. Prefer Grouping Actions into Controllers Based on How They Relate to Business Concepts
      16. Avoid Grouping Actions into Controllers Based on Technical Relation
      17. Prefer Placing Action Filters at the Highest Appropriate Level
      18. Prefer Multiple Views (and/or Partial Views) over Complex If-Then-Else Logic That Shows and Hides Sections
      19. Prefer the Post-Redirect-Get Pattern When Posting Form Data
      20. Prefer Startup Tasks over Logic Placed in Application_Start (Global.asax)
      21. Prefer Authorize Attribute over Imperative Security Checks
      22. Prefer Using the Route Attribute over More Generic Global Routes
      23. Consider Using an Antiforgery Token to Avoid CSRF Attacks
      24. Consider Using the AcceptVerbs Attribute to Restrict How Actions May Be Called
      25. Consider Output Caching
      26. Consider Removing Unused View Engines
      27. Consider Custom ActionResults for Unique Scenarios
      28. Consider Asynchronous Controllers for Controller Tasks That Can Happen in Parallel
    4. Appendix Cross-Reference: Targeted Topics, Features, and Scenarios

  7. Index

  8. Colophon

Bình luận