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.



Autorentext

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.



Inhalt

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 Vi...

Titel
Professional ASP.NET MVC 5
EAN
9781118794722
ISBN
978-1-118-79472-2
Format
E-Book (pdf)
Hersteller
Herausgeber
Veröffentlichung
15.07.2014
Digitaler Kopierschutz
Adobe-DRM
Dateigrösse
22.25 MB
Anzahl Seiten
624
Jahr
2014
Untertitel
Englisch