Librería Portfolio Librería Portfolio

Búsqueda avanzada

TIENE EN SU CESTA DE LA COMPRA

0 productos

en total 0,00 €

PROFESSIONAL ASP.NET MVC 5
Título:
PROFESSIONAL ASP.NET MVC 5
Subtítulo:
Autor:
GALLOWAY, J
Editorial:
JOHN WILEY
Año de edición:
2015
Materia
C# Y .NET
ISBN:
978-1-118-79475-3
Páginas:
624
48,50 €

 

Sinopsis

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.



Table of Contents
FOREWORD xxvii
INTRODUCTION xxix

CHAPTER 1: GETTING STARTED 1

A Quick Introduction to ASP.NET MVC 1

How ASP.NET MVC Fits in with ASP.NET 2

The MVC Pattern 2

MVC as Applied to Web Frameworks 3

The Road to MVC 5 3

MVC 4 Overview 6

Open-Source Release 10

ASP.NET MVC 5 Overview 11

One ASP.NET 11

New Web Project Experience 12

ASP.NET Identity 12

Bootstrap Templates 13

Attribute Routing 14

ASP.NET Scaffolding 14

Authentication Filters 15

Filter Overrides 15

Installing MVC 5 and Creating Applications 16

Software Requirements for ASP.NET MVC 5 16

Installing ASP.NET MVC 5 16

Creating an ASP.NET MVC 5 Application 17

The New ASP.NET Project Dialog 18

The MVC Application Structure 24

ASP.NET MVC and Conventions 27

Convention over Configuration 28

Conventions Simplify Communication 29

Summary 29

CHAPTER 2: CONTROLLERS 31

The Controller's Role 31

A Sample Application: The MVC Music Store 34

Controller Basics 38

A Simple Example: The Home Controller 39

Writing Your First Controller 42

Parameters in Controller Actions 45

Summary 47

CHAPTER 3: VIEWS 49

The Purpose of Views 50

View Basics 50

Understanding View Conventions 54

Strongly Typed Views 55

How ViewBag Falls Short 55

Understanding ViewBag, ViewData, and ViewDataDictionary 57

View Models 58

Adding a View 60

The Razor View Engine 63

What Is Razor? 63

Code Expressions 64

HTML Encoding 66

Code Blocks 68

Razor Syntax Samples 68

Layouts 70

ViewStart 72

Specifying a Partial View 73

Summary 74

CHAPTER 4: MODELS 75

Modeling the Music Store 76

Scaffolding a Store Manager 80

What Is Scaffolding? 80

Scaffolding and the Entity Framework 82

Executing the Scaffolding Template 85

Executing the Scaffolded Code 92

Editing an Album 97

Building a Resource to Edit an Album 97

Responding to the Edit POST Request 101

Model Binding 103

The DefaultModelBinder 104

Explicit Model Binding 105

Summary 107

CHAPTER 5: FORMS AND HTML HELPERS 109

Using Forms 110

The Action and the Method 110

To GET or to POST? 111

HTML Helpers 114

Automatic Encoding 115

Making Helpers Do Your Bidding 115

Inside HTML Helpers 116

Setting Up the Album Edit Form 117

Adding Inputs 118

Helpers, Models, and View Data 124

Strongly Typed Helpers 126

Helpers and Model Metadata 127

Templated Helpers 127

Helpers and ModelState 128

Other Input Helpers 129

Html.Hidden 129

Html.Password 129

Html.RadioButton 129

Html.CheckBox 130

Rendering Helpers 130

Html.ActionLink and Html.RouteLink 131

URL Helpers 132

Html.Partial and Html.RenderPartial 133

Html.Action and Html.RenderAction 133

Summary 135

CHAPTER 6: DATA ANNOTATIONS AND VALIDATION 137

Annotating Orders for Validation 138

Using Validation Annotations 141

Custom Error Messages and Localization 146

Looking Behind the Annotation Curtain 147

Controller Actions and Validation Errors 148

Custom Validation Logic 150

Custom Annotations 150

IValidatableObject 154

Display and Edit Annotations 155

Display 155

ScaffoldColumn 156

DisplayFormat 156

ReadOnly 157

DataType 157

UIHint 158

HiddenInput 158

Summary 158

CHAPTER 7: MEMBERSHIP, AUTHORIZATION, AND SECURITY 159

Security: Not fun, But Incredibly Important 159

Using the Authorize Attribute to Require Login 162

Securing Controller Actions 162

How AuthorizeAttribute Works with Forms Authentication and the AccountController 167

Windows Authentication 169

Using AuthorizeAttribute to Require Role Membership 172

Extending User Identity 174

Storing additional user profile data 174

Persistance control 174

Managing users and roles 175

External Login via OAuth and OpenID 175

Registering External Login Providers 176

Configuring OpenID Providers 178

Configuring OAuth Providers 180

Security Implications of External Logins 181

Understanding the Security Vectors in a Web Application 182

Threat: Cross-Site Scripting 183

Threat: Cross-Site Request Forgery 193

Threat: Cookie Stealing 197

Threat: Over-Posting 200

Threat: Open Redirection 202

Proper Error Reporting and the Stack Trace 207

Using Configuration Transforms 208

Using Retail Deployment Configuration in Production 209

Using a Dedicated Error Logging System 209

Security Recap and Helpful Resources 209

Summary 211

CHAPTER 8: AJAX 213

jQuery 214

jQuery Features 214

Unobtrusive JavaScript 218

Using jQuery 219

Ajax Helpers 225

Adding the Unobtrusive Ajax Script to Your Project 225

Ajax ActionLinks 226

HTML 5 Attributes 230

Ajax Forms 230

Client Validation 233

jQuery Validation 233

Custom Validation 236

Beyond Helpers 241

jQuery UI 242

Autocomplete with jQuery UI 243

JSON and Client-Side Templates 246

Bootstrap Plugins 251

Improving Ajax Performance 253

Using Content Delivery Networks 253

Script Optimizations 253

Bundling and Minification 254

Summary 255

CHAPTER 9: ROUTING 257

Uniform Resource Locators 258

Introduction to Routing 259

Comparing Routing to URL Rewriting 259

Routing Approaches 260

Defining Attribute Routes 260

Defining Traditional Routes 271

Choosing Attribute Routes or Traditional Routes 280

Named Routes 280

MVC Areas 282

Catch-All Parameter 284

Multiple Route Parameters in a Segment 285

StopRoutingHandler and IgnoreRoute 286

Debugging Routes 286

Inside Routing: How Routes Generate URLs 288

High-Level View of URL Generation 288

A Detailed Look at URL Generation 289

Ambient Route Values 291

More Examples of URL Generation with the Route Class 293

Inside Routing: How Routes Ti