| Contents at a Glance | 5 |
---|
| Contents | 6 |
---|
| About the Author | 17 |
---|
| About the Technical Reviewer | 18 |
---|
| Acknowledgments | 19 |
---|
| Introduction | 20 |
---|
| Who This Book Is For | 20 |
| How This Book Is Structured | 21 |
| Sample Code | 21 |
| Errata | 21 |
| Customer Support | 21 |
| Contacting the Author | 22 |
| Part 1 Introducing ASP.NET MVC | 23 |
---|
| Chapter 1 What s the Big Idea? | 24 |
| A Brief History of Web Development | 24 |
| Web Development Today | 26 |
| Key Benefits of ASP.NET MVC | 28 |
| Who Should Use ASP.NET MVC? | 31 |
| Summary | 34 |
| Chapter 2 Your First ASP.NET MVC Application | 35 |
| Preparing Your Workstation | 35 |
| Creating a New ASP.NET MVC Project | 36 |
| Rendering Web Pages | 40 |
| A Starter Application | 43 |
| Summary | 55 |
| Chapter 3 Prerequisites | 56 |
| Understanding Model-View-Controller Architecture | 56 |
| Domain Modeling | 63 |
| Building Loosely Coupled Components | 75 |
| Getting Started with Automated Testing | 80 |
| New C# 3 Language Features | 87 |
| Summary | 99 |
| Chapter 4 SportsStore: A Real Application | 100 |
| Getting Started | 101 |
| Starting Your Domain Model | 104 |
| Displaying a List of Products | 106 |
| Connecting to a Database | 111 |
| Setting Up Inversion of Control | 116 |
| Creating Automated Tests | 121 |
| Configuring a Custom URL Schema | 125 |
| Styling It Up | 133 |
| Summary | 138 |
| Chapter 5 SportsStore: Navigation and Shopping Cart | 139 |
| Adding Navigation Controls | 139 |
| Building the Shopping Cart | 158 |
| Submitting Orders | 174 |
| Summary | 187 |
| Chapter 6 SportsStore: Administration and Final Enhancements | 188 |
| Adding Catalog Management | 189 |
| Securing the Administration Features | 205 |
| Image Uploads | 212 |
| Part 2 ASP.NET MVC in Detail | 218 |
---|
| Chapter 7 Overview of ASP.NET MVC Projects | 219 |
| Developing MVC Applications in Visual Studio | 219 |
| The Request Processing Pipeline | 229 |
| Summary | 235 |
| Chapter 8 URLs and Routing | 236 |
| Putting the Programmer Back in Control | 236 |
| Setting Up Routes | 237 |
| Generating Outgoing URLs | 251 |
| Unit Testing Your Routes | 260 |
| Further Customization | 266 |
| URL Schema Best Practices | 268 |
| Summary | 273 |
| Chapter 9 Controllers and Actions | 274 |
| An Overview | 274 |
| Receiving Input | 277 |
| Producing Output | 281 |
| Using Filters to Attach Reusable Behaviors | 301 |
| Controllers As Part of the Request Processing Pipeline | 318 |
| Testing Controllers and Actions | 327 |
| Summary | 335 |
| Chapter 10 Views | 336 |
| How Views Fit into ASP.NET MVC | 336 |
| WebForms View Engine Basics | 338 |
| Using Inline Code | 339 |
| Understanding How MVC Views Actually Work | 341 |
| Using HTML Helper Methods | 347 |
| Using Partial Views | 359 |
| Using Html.RenderAction to Create Reusable Widgets with Application Logic | 366 |
| Sharing Page Layouts Using Master Pages | 370 |
| Implementing a Custom View Engine | 373 |
| Summary | 383 |
| Chapter 11 Data Entry | 384 |
| Model Binding | 384 |
| Validation | 398 |
| Wizards and Multistep Forms | 411 |
| Verification | 421 |
| Summary | 433 |
| Chapter 12 Ajax and Client Scripting | 434 |
| Why You Should Use a JavaScript Toolkit | 434 |
| ASP.NET MVC s Ajax Helpers | 435 |
| Using jQuery with ASP.NET MVC | 446 |
| Summary | 473 |
| Chapter 13 Security and Vulnerability | 474 |
| All Input Can Be Forged | 474 |
| Cross-Site Scripting and HTML Injection | 478 |
| Session Hijacking | 483 |
| Cross-Site Request Forgery | 485 |
| SQL Injection | 488 |
| Using the MVC Framework Securely | 490 |
| Summary | 491 |
| Chapter 14 Deployment | 492 |
| Server Requirements | 492 |
| IIS Basics | 493 |
| Deploying Your Application | 498 |
| Making Your Application Behave Well in Production | 512 |
| Summary | 518 |
| Chapter 15 ASP.NET Platform Features | 519 |
| Windows Authentication | 520 |
| Forms Authentication | 523 |
| Membership, Roles, and Profiles | 528 |
| URL-Based Authorization | 543 |
| Data Caching | 544 |
| Site Maps | 548 |
| Internationalization | 554 |
| Performance | 560 |
| Summary | 568 |
| Chapter 16 Combining MVC and WebForms | 569 |
| Using WebForms Technologies in an MVC Application | 569 |
| Using ASP.NET MVC in a WebForms Application | 577 |
| Summary | 585 |
| Index | 586 |