Professional ASP.NET MVC 5
Description
ASP.NET MVC insiders cover the latest updates to the technology in this popular Wrox reference
MVC 5 is the newest update to the popular Microsoft technology that enables you to build dynamic, data-driven websites. Like previous versions, this guide shows you step-by-step techniques on using MVC to best advantage, with plenty of practical tutorials to illustrate the concepts. It covers controllers, views, and models; forms and HTML helpers; data annotation and validation; membership, authorization, and security.
- MVC 5, the latest version of MVC, adds sophisticated features such as single page applications, mobile optimization, and adaptive rendering
- A team of top Microsoft MVP experts, along with visionaries in the field, provide practical advice on basic and advanced MVC topics
- Covers controllers, views, models, forms, data annotations, authorization and security, Ajax, routing, ASP.NET web API, dependency injection, unit testing, real-world application, and much more
Professional ASP.NET MVC 5 is the comprehensive resource you need to make the best use of the updated Model-View-Controller technology.
Foreword xxvii
Introduction xxix
Chapter 1: Getting Started 1
A Quick Introduction to ASP.NET MVC 1
ASP.NET MVC 5 Overview 11
Installing MVC 5 and Creating Applications 16
The MVC Application Structure 24
Summary 29
Chapter 2: Controllers 31
The Controller’s Role 31
A Sample Application: The MVC Music Store 34
Controller Basics 38
Summary 47
Chapter 3: Views 49
The Purpose of Views 50
View Basics 50
Understanding View Conventions 54
Strongly Typed Views 55
View Models 58
Adding a View 60
The Razor View Engine 63
Specifying a Partial View 73
Summary 74
Chapter 4: Models 75
Modeling the Music Store 76
Scaffolding a Store Manager 80
Editing an Album 97
Model Binding 103
Summary 107
Chapter 5: Forms and Html Helpers 109
Using Forms 110
HTML Helpers 114
Other Input Helpers 129
Rendering Helpers 130
Summary 135
Chapter 6: Data Annotations and Validation 137
Annotating Orders for Validation 138
Custom Validation Logic 150
Display and Edit Annotations 155
Summary 158
Chapter 7: Membership, Authorization, and Security 159
Security: Not fun, But Incredibly Important 159
Using the Authorize Attribute to Require Login 162
Using AuthorizeAttribute to Require Role Membership 172
Extending User Identity 174
External Login via OAuth and OpenID 175
Understanding the Security Vectors in a Web Application 182
Proper Error Reporting and the Stack Trace 207
Security Recap and Helpful Resources 209
Summary 211
Chapter 8: Ajax 213
jQuery 214
Ajax Helpers 225
Client Validation 233
Beyond Helpers 241
Improving Ajax Performance 253
Summary 255
Chapter 9: Routing 257
Uniform Resource Locators 258
Introduction to Routing 259
Inside Routing: How Routes Generate URLs 288
Inside Routing: How Routes Tie Your URL to an Action 294
Chapter 10: Nuget 299
Introduction to NuGet 299
Adding a Library as a Package 301
Creating Packages 312
Publishing Packages 325
Summary 332
Chapter 11: Asp.Net Web Api 333
Defining ASP.NET Web API 334
Getting Started with Web API 335
Writing an API Controller 335
Configuring Web API 342
Adding Routes to Your Web API 346
Binding Parameters 347
Filtering Requests 349
Enabling Dependency Injection 350
Exploring APIs Programmatically 350
Tracing the Application 352
Web API Example: ProductsController 352
Summary 354
Chapter 12: Single Page Applications With Angularjs 355
Understanding and Setting Up AngularJS 356
Building the Web API 363
Building Applications and Modules 364
Summary 384
Chapter 13: Dependency Injection 385
Software Design Patterns 385
Dependency Resolution in MVC 395
Dependency Resolution in Web API 402
Summary 405
Chapter 14: Unit Testing 407
Understanding Unit Testing and Test-Driven Development 408
Building a Unit Test Project 412
Advice for Unit Testing Your ASP.NET MVC and ASP.NET Web API Applications 415
Summary 427
Chapter 15: Extending Mvc 429
Extending Models 430
Extending Views 442
Extending Controllers 446
Summary 458
Chapter 16: Advanced Topics 461
Mobile Support 461
Advanced Razor 473
Advanced View Engines 476
Advanced Scaffolding 482
Advanced Routing 486
Advanced Templates 492
Advanced Controllers 498
Summary 520
Chapter 17: Real-World Asp.Net Mvc: Building The Nuget.Org Website 521
May the Source Be with You 522
WebActivator 526
ASP.NET Dynamic Data 527
Exception Logging 530
Profiling 532
Data Access 535
EF Code–Based Migrations 536
Deployments with Octopus Deploy 539
Automated Browser Testing with Fluent Automation 540
Other Useful NuGet Packages 541
Summary 544
Appendix: ASP.NET MVC 5.1 545
ASP.NET MVC 5.1 Release Description 545
Enum Support in ASP.NET MVC Views 549
Attribute Routing with Custom Constraints 553
Bootstrap and JavaScript Enhancements 558
Summary 563
Index 565
Jon Galloway works at Microsoft as a Technical Evangelist focused on ASP.NET MVC.
Brad Wilson has been a professional software developer for more than 20 years, with 10 years in web development.
K. Scott Allen is the founder of OdeToCode LLC, which provides custom development, consulting, and mentoring services for clients worldwide.
David Matson is a software developer at Microsoft. He is part of the MVC 5 and Web API 2 product team.
Build dynamic, data-driven websites with MVC 5
MVC 5 is the latest update to Microsoft’s popular MVC (Model-View-Controller) technology—an established web application framework that enables fast, TDD-friendly development. MVC allows developers to build dynamic, data-driven websites with sophisticated features, such as single page applications, mobile optimization, adaptive rendering, and more. Updated to cover new post-release features in MVC 5.1 and 5.2, this book offers step-by-step techniques to use MVC to its full advantage. Written by top ASP.NET MVC experts at Microsoft, along with visionaries in the field, the book’s practical tutorials reinforce concepts and allow developers to create their own applications.
Professional ASP.NET MVC 5:
- Explains how the ASP.NET MVC framework differs from other file-per-page web frameworks
- Covers controllers, views, models, forms, HTML helpers, data annotation and validation, membership, authorization, security, and routing
- Includes new coverage of One ASP.NET project templates, ASP.NET Identity, Bootstrap and Attribute routing
- Discusses essential topics such as Ajax, NuGet, dependency injection, unit testing, and extending MVC
- Features step-by-step guidance, real-world examples, and numerous code samples to move readers from the basic to the advanced
Wrox Professional guides are planned and written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job.
Programmer Forums
Join our Programmer to Programmer forums to ask and answer programming questions about this book, join discussions on the hottest topics in the industry, and connect with fellow programmers from around the world.
Code Downloads
Take advantage of free code samples from this book, as well as code samples from hundreds of other books, all ready to use.
Read More
Find articles, e-books, sample chapters, and tables of contents for hundreds of books, and more reference resources on programming topics that matter to you.
PUBLISHER:
Wiley
ISBN-13:
9781118794753
BINDING:
Paperback
BISAC:
COMPUTERS
BOOK DIMENSIONS:
Dimensions: 188.00(W) x Dimensions: 233.70(H) x Dimensions: 38.10(D)
AUDIENCE TYPE:
General/Adult
LANGUAGE:
English