Programming Microsoft ASP.NET MVC [NOOK Book]

Overview

Fully updated for ASP.NET MVC 3. Delve into the features, principles, and pillars of the ASP.NET MVC framework—deftly guided by web development luminary Dino Esposito. ASP.NET MVC forces developers to think in terms of distinct components—Model, View, Controller—that make it easier to manage application complexity, while allowing strict control over the markup. Plunge into the framework’s internal mechanics and gain perspectives on how to use this programming model versus Web Forms, and begin building your own ...

See more details below
Programming Microsoft ASP.NET MVC

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99
BN.com price
(Save 44%)$35.99 List Price

Overview

Fully updated for ASP.NET MVC 3. Delve into the features, principles, and pillars of the ASP.NET MVC framework—deftly guided by web development luminary Dino Esposito. ASP.NET MVC forces developers to think in terms of distinct components—Model, View, Controller—that make it easier to manage application complexity, while allowing strict control over the markup. Plunge into the framework’s internal mechanics and gain perspectives on how to use this programming model versus Web Forms, and begin building your own MVC-based applications quickly.

Read More Show Less

Product Details

  • ISBN-13: 9780735666597
  • Publisher: Pearson Education
  • Publication date: 10/29/2011
  • Series: Developer Reference
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 2
  • Pages: 464
  • File size: 5 MB

Meet the Author

Dino Esposito is a well-known ASP.NET, AJAX, and Microsoft Silverlight® expert who has written or co-written several popular books, including Microsoft ASP.NET and Ajax: Architecting Web Applications and Programming Microsoft ASP.NET 4. He is a regular contributor to MSDN® Magazine and speaks at industry events such as DevConnections and Microsoft TechEd.

Read More Show Less

Table of Contents

Acknowledgments

Introduction

Part I The Programming Paradigm

1 Goals of ASPNET MVC and Motivation for its Development 3

The Deep Impact of ASPNET 5

Productivity Is King 6

The Web Forms Model 9

The "Page Controller" Pattern 11

The ASP.NET Age of Reason 16

ASP.NET's Signs of Aging 16

The Turning Point 20

ASP.NET MVC at a Glance 26

ASP.NET MVC Highlights 26

Web Forms vs ASP.NET MVC 30

Summary 35

2 The Runtime Environment 37

The ASP.NET Runtime Machinery 37

ASP.NET and the IIS Web Server 38

Life Cycle of an ASP.NET Request 44

What's an HTTP Handler, Anyway? 51

What's an HTTP Module, Anyway? 57

URL Routing 61

The ASP.NET MVC Run-Time Shell 67

The Big Picture 68

Processing an ASP.NET MVC Request 75

Summary 80

3 The MVC Pattern and Beyond 81

The Original MVC Pattern 82

MVC Interaction Model 82

The Original Idea 83

Presenting the Actors 84

Limitations of the MVC Pattern 89

The Model2 Pattern 90

MVC and the Web 90

Model2 and ASP.NET MVC 93

Presentation-Oriented Variations of MVC 98

The MVP Pattern 98

Presentation Model Pattern (Also Known as MVVM) 103

The ASP.NET MVC Project Template 107

Peculiarities of an ASP.NET MVC Project 108

ASP.NET MVC Special Folders 113

Summary 118

Part II The Core of ASP.NET MVC

4 Inside Controllers 123

The Role of Controllers and the Motivation for Using Them 123

Beyond the Code-Behind Approach 124

Introducing Controllers 128

Mechanics of Controllers in ASP.NET MVC 132

Anatomy of an ASP.NET MVC Controller 135

Inside the Structure of a Controller 135

Behavior of a Controller 144

Attributes of Controllers and Action Methods 156

Writing a Controller 167

Design of a Controller Class 167

Should You Use Your Own Base Class? 176

Special Capabilities 183

Grouping Controllers 184

Asynchronous Controllers 187

Render Actions- 195

Controllers and Testability 199

Making Controllers Easy to Test 199

Writing Unit Tests 204

Summary 209

5 Inside Views 211

Views and Controllers 212

From Controllers to Views 212

Building the Response for the Browser 213

Anatomy of an ASP.NET MVC View 215

Selecting the View 215

Creating the View 220

The Default View Engine 222

The Web Forms View Engine 226

Writing a View 233

The View's Template 235

Filling Up the View 241

HTML Helpers 252

Templated HTML Helpers 257

Datagrids and Paged Views 261

Testing a View 273

Summary 275

6 Inside Models 277

What's the Model, Anyway? 278

How Many Types of Models Do You Know? 278

The Models Folder 282

Domain Model and View-Model 286

Business Object Modeling 286

Adding Validation Logic to the Model 291

Data for the View 299

Model Binding 305

The Model Binder in Action 306

Summary 313

Part III Programming Features

7 Data Entry in ASP.NET MVC 317

The Select-Edit-Save Pattern 318

Presenting Data 318

Editing Data 320

Saving Data 324

Data Validation 326

Validation on the Server Side 326

Giving Feedback to the User 334

Data Annotations and Validators 342

Client-Side Validation 351

Summary 354

8 The ASP.NET MVC Infrastructure 355

Routing 356

Dealing with Routes 356

Keeping an Eye on SEO 362

Error Handling 366

Foundations of ASP.NET Error Handling 366

Dealing with Missing Content 371

Localization 374

Making Resources Localizable 374

Dealing with Resources in ASP.NET MVC 376

Dependency Injection 382

Dependency Inversion in Action 383

A Brief Tour of Unity 391

Creating a Global Container 395

Summary 399

9 AJAX Capabilities 401

AJAX in ASP.NET 401

Partial Rendering 402

Direct Scripting 405

AJAX in ASP.NET MVC 408

The JavaScript API 408

The Controller Facade 413

AJAX Helpers in ASP.NET MVC 420

Partial Rendering in ASP.NET MVC 428

Summary 432

10 Testability and Unit Testing 435

Testability and Design 436

Design for Testability 436

Loosen Up Your Design 438

Basics of Unit Testing 443

Working with a Test Harness 443

Aspects of Testing 447

Unit Testing in ASP.NET MVC 454

Testing Controller Actions 454

Injecting Mocks and Fakes 458

Mocking the HTTP Context 463

More Specific Tests 471

Summary 475

11 Customizing ASP.NET MVC 477

The Controller Factory 477

ASP.NET MVC Request Processing 478

Extending the Default Controller Factory 480

Invoking Actions 487

Action Filters 496

Gallery of Action Filters 496

Loading Action Filters Dynamically 505

Action Selectors 509

Action Results and Rendering 512

Processing the Result of the Action 512

Custom ActionResult Objects 514

View Engines 521

HTML Helpers 529

Summary 538

Appendix: ReSharper and the Power of Tools 539

IntelliSense Extensions 539

Choose the Right View Name with IntelliSense Tips 540

Action Links and URLs 541

User Controls 542

Static Analysis to Detect Missing Views and Actions 542

Coding Assistants 543

Creating Views by Usage 543

Navigation 545

Controller and View Navigation 545

Locating Symbols 547

Navigating Inside Master and Content Pages 547

Refactoring forASP.NET MVC 548

Conclusion 549

Index 551

Read More Show Less

Customer Reviews

Average Rating 4.5
( 2 )
Rating Distribution

5 Star

(1)

4 Star

(1)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted March 8, 2012

    Shocktip to berriestar

    She isnt my mate anymore. I have a new beautiful one

    Was this review helpful? Yes  No   Report this review
  • Posted November 17, 2010

    Excellent source for learning to program Asp_Net MVC 2

    This book is not a tutorial. While there is a lot of useful sample code, you won't find step by step instructions to create an MVC application. This book is also not a quick reference guide. While it is full of information, it is designed to be read and studied.

    This book rates 4 stars for providing a thorough explanation of the features of ASP_Net MVC 2 and the programming philosophy behind it. The author goes beyond describing the various features, methods and architecture and gives the reasoning behind them. He not only describes HOW to do things, but gives very clear information about WHY you would want to do things in a particular way. The sections on customizing the built-in objects are extremely insightful.

    Unfortunately, I had major problems trying to run the downloaded companion code under Visual Studio 2008 with .Net 3.5 framework. But that did not detract from the excellence of this book for learning to program Microsoft Asp_net MVC 2

    Pros : Easy to understand, Helpful examples, Well-written
    Best Uses : Expert, Thorough study, Intermediate
    Describe Yourself : Developer, Designer

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)