Beginning ASP. NET MVC 1. 0

by ;
Format: Paperback
Pub. Date: 2009-08-01
Publisher(s): Wrox
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $52.49

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

If you have a background in .NET and ASP.NET and are seeking to learn ASP.NET MVC, then this is the book for you. Relying heavily on MVC concepts, ASP.NET MVC principles, and code to demonstrate the main content, this valuable resource walks you through the necessary components to solve real-world problems.

Table of Contents

Forewordp. xxvii
Introductionp. xxix
The Model-View-Controller Patternp. 1
The History of MVCp. 1
The Principles of MVCp. 2
How the MVC Pattern Flowsp. 2
The Passive Viewp. 4
The Presentation Modelp. 5
The Model-View-Presenter Patternp. 6
Advantages of MVC over Traditional Web Developmentp. 7
Unit Testingp. 8
Test Driven Developmentp. 8
The Interface First Approachp. 9
Summaryp. 9
Exercisesp. 10
ASP.NET WebForms vs. ASP.NET MVCp. 11
Overviewp. 12
Contrasting ASP.NET WebForms with ASP.NET MVCp. 12
Problems with ASP.NET WebFormsp. 13
How ASP.NET MVC Resolves Issues with ASP.NET WebFormsp. 14
The Programming Modelp. 15
The ASP.NET WebForms Programming Modelp. 15
The ASP.NET MVC Programming Modelp. 16
The Main Elements of ASP.NET Developmentp. 17
How ASP.NET, ASP.NET WebForms, and ASP.NET MVC Relatep. 17
The Implementation of the MVC Pattern in ASP.NET MVCp. 19
The Model in ASP.NET MVCp. 19
The Controller in ASP.NET MVCp. 19
The View in ASP.NET MVCp. 21
Routing in ASP.NET MVCp. 22
Summaryp. 23
Exercisep. 23
Getting Started with ASP.NET MVCp. 25
Installing ASP.NET MVCp. 26
Creating an ASP.NET MVC Projectp. 27
Examining the Solution Structurep. 28
The Controllerp. 29
The Viewp. 30
The Modelp. 30
The ASP.NET MVC Application Classp. 31
The Web Configuration Filep. 32
The Content Filesp. 32
The Script Filesp. 32
Test Projectsp. 32
An ASP.NET MVC Examplep. 35
Summaryp. 42
Exercisesp. 43
The Modelp. 45
What Microsoft Provides for the "M" in MVCp. 46
An Overview of the Modelp. 47
Different Options for Building the Modelp. 47
LINQ to SQLp. 48
ADO.NET Database Objectsp. 52
ADO.NET Entity Frameworkp. 55
XMLp. 60
Important Considerations about Creating Data Modelsp. 64
Third-Party Components and Toolsp. 64
Summaryp. 65
Exercisep. 65
The Controllerp. 67
What the Controller Doesp. 67
Creating a Controllerp. 68
Defining an Actionp. 70
Attributes That Control Action Definitionp. 70
Passing Data to the Viewp. 72
ViewDatap. 72
Retrieving Data from the Requestp. 77
Action Parametersp. 78
Binding Data Inside the Actionp. 82
Types of Action Resultsp. 83
ViewResultp. 83
PartialViewResultp. 84
RedirectResultp. 85
RedirectToRouteResultp. 87
JsonResultp. 89
JavaScriptResultp. 90
ContentResultp. 90
FileContentResultp. 91
EmptyResultp. 91
Using the Core ASP.NET Objectsp. 91
Summaryp. 92
Exercisesp. 92
The Viewp. 93
The Responsibilities of the Viewp. 93
The Anatomy of a Viewp. 93
Creating a View with Visual Studiop. 95
Loosely Typed Viewsp. 96
Strongly Typed Viewsp. 98
Writing HTML the ASP.NET MVC Wayp. 100
Link-Building Helpersp. 101
Form Helpersp. 104
Validation Helpersp. 118
What about the Rest?p. 120
Writing Your Own Helper Methodsp. 121
A Shortcut for Creating Viewsp. 124
Summaryp. 127
Exercisesp. 127
Routingp. 129
Life before Routingp. 129
Key Conceptsp. 130
The Anatomy of a Routep. 130
The URL Propertyp. 131
The Defaults Propertyp. 131
The Constraints Propertyp. 132
The DataTokens Propertyp. 136
The RouteHandler Propertyp. 139
How to Register Routesp. 139
Easier Route Management with ASP.NET MVCp. 141
Debugging Routesp. 142
Summaryp. 144
Exercisesp. 145
Unit Testing Conceptsp. 147
What Is Unit Testing?p. 147
The Benefits of Unit Testingp. 148
The Structure of a Unit Testp. 149
The Four Phases of a Testp. 149
Fixturesp. 149
The Order of Executionp. 150
Attributes That Control Testingp. 150
Result Verificationp. 150
Code Coveragep. 152
Writing Tests with Visual Studiop. 152
The Visual Studio Testing User Interfacep. 153
Writing Your First Test Classp. 158
Testing Classes That Depend on External Componentsp. 161
Patterns That Make Testing Easierp. 162
Using a Test Doublep. 165
Mock Objectsp. 167
Summaryp. 170
Exercisesp. 170
Testing ASP.NET MVC Applicationsp. 173
Creating a Test Project for ASP.NET MVCp. 173
Testing without Mockingp. 174
Testing Actions That Render Somethingp. 175
Testing Actions That Redirect to Another Actionp. 179
System.Web.Abstractionsp. 183
Testing with Mockingp. 183
Testing Routesp. 186
Putting It All Togetherp. 187
Analyzing a Legacy Applicationp. 187
Refactoring to Testablep. 188
Testing the Applicationp. 191
Developing with a TDD Approachp. 197
Requirementsp. 198
Testing for Christmas Dayp. 198
Testing for Any Other Dayp. 199
Testing for New Year's Dayp. 201
It's Refactoring Timep. 202
Summaryp. 203
Exercisesp. 203
Componentsp. 205
Why Are There No Server Controls?p. 205
Server Controlsp. 206
A Simple Form Controlp. 207
Components with Rendering Onlyp. 208
Controls with Databindingp. 210
Using Partial Viewsp. 211
Writing a Custom HtmlHelperp. 218
Rendering the Result of an Actionp. 222
Writing Client-Side Components with JavaScriptp. 223
When to Use Which Optionp. 224
Summaryp. 224
Exercisesp. 225
Action Filtersp. 227
What Is an Action Filter?p. 227
Types of Filtersp. 228
The Core Filtersp. 229
The HandleError Filterp. 229
The Authorize Filterp. 233
The ValidateInput Filterp. 234
The ValidateAntiforgeryToken Filterp. 234
The OutputCache Filterp. 234
Building a Custom Action Filterp. 236
The Base Class: ActionFilterAttributep. 236
Controller-Scoped Filtersp. 241
The Filter Execution Orderp. 242
Using Action Filtersp. 245
Canceling the Execution of an Actionp. 245
Adding More Data for the Viewp. 249
Summaryp. 255
Exercisesp. 256
AJAXp. 257
What Is AJAX?p. 258
ASP.NET AJAXp. 259
jQueryp. 261
AJAX in ASP.NET MVCp. 263
Adding AJAX Referencesp. 263
Principles of AJAX Development in ASP.NET MVC Applicationsp. 266
Putting It into Action: Using AJAX in ASP.NET MVCp. 267
Summaryp. 273
Exercisesp. 273
Deploymentp. 275
ASP.NET Deployment Overviewp. 276
ASP.NET MVC Hosting Optionsp. 276
GAC Installationp. 277
Assembly Deploymentp. 277
Hosting Prerequisitesp. 278
The .NET Security Policyp. 279
The Web Platform Installerp. 280
Publishing Web Applicationsp. 284
Summaryp. 286
Leveraging ASP.NET WebForm Featuresp. 287
Cachingp. 288
Caching in ASP.NETp. 289
Caching in ASP.NET MVCp. 289
Validationp. 295
Validation in ASP.NET MVCp. 296
Validation with Model Statep. 297
Master Pagesp. 303
Other Featuresp. 305
Sitemapsp. 305
The Profile Systemp. 306
Health Monitoringp. 306
Server Controlsp. 306
Summaryp. 306
Exercisesp. 307
Authentication and Authorizationp. 309
Principles of Authentication and Authorizationp. 310
Authentication and Authorization in ASP.NETp. 311
The Membership Providerp. 312
The Role Providerp. 312
Authentication and Authorization in ASP.NET MVCp. 313
Configuring Your Application to Use Authorization and Authenticationp. 313
Custom Membership and Role Providersp. 318
Limiting Access to Resources with the Authorize Action Filterp. 318
Authentication and Authorization in Action in ASP.NET MVCp. 319
Summaryp. 333
Exercisesp. 333
Extending ASP.NET MVCp. 335
Introduction to Extensibilityp. 335
Areas of Extensibilityp. 336
Route Handlersp. 337
Writing a Custom Route Handlerp. 337
A Generic WebFormRouteHandlerp. 339
The Controller Factoryp. 341
Anatomy of a Controller Factoryp. 341
Using the Ninject Custom Controller Factoryp. 342
View Enginesp. 346
Writing a Custom View Enginep. 347
Using a Custom View Enginep. 352
Alternative View Enginesp. 352
Minor Extensibility Pointsp. 371
ActionMethodSelectorAttributep. 371
TempDataProviderp. 372
Custom ActionResultp. 374
Summaryp. 376
Exercisesp. 376
Migrating from ASP.NET WebFormsp. 379
Why Migrate?p. 380
Overview of the Migration Processp. 381
Fundamental Similarities between ASP.NET WebForms and ASP.NET MVCp. 382
Authentication and Authorization Similaritiesp. 382
Provider Similaritiesp. 382
HttpModule and HttpHandlerp. 382
Fundamental Differences between ASP.NET WebForms and ASP.NET MVCp. 383
The ViewState Differencep. 383
Differences in Using Server Controlsp. 383
Code Model Differencesp. 383
Event Model Differencesp. 384
Differences in Using URLsp. 384
Differences in the Separation of Resourcesp. 385
Validation Differencesp. 385
Differences in Support for AJAXp. 385
Replacing Controls During Migration to ASP.NET MVCp. 385
Migrating a Simple WebForms Applicationp. 386
Summaryp. 394
Exercisep. 394
Case Study 1p. 395
The WroxBlog Overviewp. 397
The WroxBlog Modelsp. 397
The WroxBlog Database Structurep. 398
The LINQ to SQL Modelp. 399
The Servicesp. 399
The WroxBlog Controllersp. 407
Implementing HomeControllerp. 407
Implementing PostControllerp. 408
Implementing CategoryControllerp. 409
The WroxBlog Viewsp. 410
The Site Masterp. 410
Adding the Categories Controlp. 412
Adding the Post Controlp. 413
Adding the Posts Controlp. 414
Adding the Comment Controlp. 414
Adding the Comments Controlp. 415
Adding the CommentForm Controlp. 415
Creating the Home Viewp. 416
Adding the About Viewp. 417
Creating the IndividualPost Viewp. 417
Creating the CategoryIndex Viewp. 418
WroxBlog Routingp. 418
Check It Outp. 420
Summaryp. 423
Exercisesp. 423
Case Study 2p. 425
User Stories (aka Requirements)p. 425
The WroxGallery External Librariesp. 426
Flickr.NETp. 426
Using the TDD Approachp. 427
Building the WroxGallery Modelp. 428
Creating the Data Modelp. 428
Implementing the WroxGallery Servicesp. 430
The WroxGallery Controllerp. 437
The Home Controllerp. 437
WroxGallery Account Controllerp. 440
Building the Admin Controllerp. 443
Configuring the IoCCp. 443
Creating the WroxGallery Viewsp. 445
Creating the Master Pagesp. 446
Adding the Content Pagesp. 449
Using AJAX and jQueryp. 450
The Lightbox Plug-Inp. 451
The Autocomplete Plug-Inp. 451
Running More Testsp. 456
The WroxGallery in Actionp. 456
Summaryp. 458
Exercisep. 458
Resourcesp. 459
Communitiesp. 459
Blogsp. 459
Booksp. 460
Toolsp. 460
Exercise Solutionsp. 461
Indexp. 521
Table of Contents provided by Ingram. All Rights Reserved.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.