中文名: ASP.NET MVC系列
英文名: ASP.NET MVC
版本: PDF
发行时间: 2009年
地区: 美国
对白语言: 英语
文字语言: 英文
简介:
引用
ASP.NET MVC is a free and fully supported Microsoft framework for building web applications that use a model-view-controller pattern. Like ASP.NET Web Forms, ASP.NET MVC is built on the ASP.NET framework.
ASP.NET MVC provides the following benefits:
•Provides complete control over your HTML markup
•Enables rich AJAX integration
•Intuitive website URLs
•Clear separation of concerns which results in web applications that are easier to maintain and extend over time.
•Testability – including support for test-driven development.
模型-视图-控制器(MVC)是XeroxPARC在八十年代为编程语言Smalltalk-80发明的一种软件设计模式,至今已被广泛使用。最近几年被推荐为Sun公司J2EE平台的设计模式,并且受到越来越多的使用 ColdFusion 和 PHP 的开发者的欢迎。模型-视图-控制器模式是一个有用的工具箱,它有很多好处,但也有一些缺点。
MVC如何工作
MVC是一个设计模式,它强制性的使应用程序的输入、处理和输出分开。使用MVC应用程序被分成三个核心部件:模型、视图、控制器。它们各自处理自己的任务。
书名:Pro ASP.NET MVC Framework
作者:Steven Sanderson
出版社:Apress
ISBN-13 (pbk): 978-1-4302-1007-8
ISBN-13 (electronic): 978-1-4302-1008-5
目录:
About the Author. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
PART 1 n n n Introducing ASP.NET MVC
nCHAPTER 1 What’s the Big Idea?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
nCHAPTER 2 Your First ASP.NET MVC Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
nCHAPTER 3 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
nCHAPTER 4 SportsStore: A Real Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
nCHAPTER 5 SportsStore: Navigation and Shopping Cart. . . . . . . . . . . . . . . . . . . . 121
nCHAPTER 6 SportsStore: Administration and Final Enhancements . . . . . . . . . . 171
PART 2 n n n ASP.NET MVC in Detail
nCHAPTER 7 Overview of ASP.NET MVC Projects. . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
nCHAPTER 8 URLs and Routing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
nCHAPTER 9 Controllers and Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
nCHAPTER 10 Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
nCHAPTER 11 Data Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
nCHAPTER 12 Ajax and Client Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
nCHAPTER 13 Security and Vulnerability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
nCHAPTER 14 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
nCHAPTER 15 ASP.NET Platform Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
nCHAPTER 16 Combining MVC and WebForms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
nINDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
书名:ASP.NET MVC 1.0 Quickly
作者:Maarten Balliauw
出版社:Packt Publishing
目录:
Preface 1
Chapter 1: ASP.NET MVC 7
Model-view-controller 7
View 8
Controller 8
The ASP.NET MVC framework 9
Driving goals of the ASP.NET MVC framework 10
Comparing ASP.NET MVC and ASP.NET Webforms 11
Choosing between ASP.NET MVC and ASP.NET Webforms 13
Summary 14
Chapter 2: Your First ASP.NET MVC Application 15
Creating a new ASP.NET MVC web application project 16
What's inside the box? 18
Strong-typed ViewData 24
Creating a new view 26
Unit testing the controller 27
Summary 29
Chapter 3: Handling Interactions 31
Creating a form 33
Creating a form using HTML 33
Creating a form using HtmlHelper 34
Handling posts 37
Request variables 37
Updating objects from request variables 37
Action method parameters 38
Handling file uploads 39
Creating an upload form 39
Creating an upload controller action 39
Using the ModelBinder attribute 40
Using the default ModelBinder 41
Creating a custom ModelBinder 43
Validating data 45
Summary 49
Chapter 4: Components in the ASP.NET MVC framework 51
The ASP.NET MVC request life cycle 51
The RouteTable is created 52
The UrlRoutingModule intercepts the request 53
The routing engine determines the route 53
The route handler creates the associated IHttpHandler 53
The IHttpHandler determines the controller 53
The controller executes 54
A ViewEngine is created 54
The view is rendered 54
Extensibility 54
Route objects 54
MvcRouteHandler 55
ControllerFactory 55
Controller 55
ViewEngine 55
View 56
The model in depth 56
Creating a model 56
Enabling validation on the model 58
The controller in depth 60
Creating a controller 60
Rendering data on the response 61
Reading data from the request 62
Action method selection 63
Handling unknown controller actions 64
Action method attributes 66
The view in depth 68
Location of views 69
Creating a view 70
Master pages 71
View markup 72
Partial views 74
Action filters 75
IAuthorizationFilter 75
IActionFilter 76
IResultFilter 76
IExceptionFilter 76
Summary 77
Chapter 5: Routing 79
What is ASP.NET routing? 79
ASP.NET routing versus URL rewriting 80
UrlRoutingModule 80
Route patterns 81
Defining routes 82
Parameter constraints 84
Catch-all routes 85
Routing namespaces 86
Combining ASP.NET MVC and ASP.NET in one web application 88
Creating URLs from routes 89
Summary 90
Chapter 6: Customizing and Extending the
ASP.NET MVC Framework 91
Creating a control 92
Creating a filter attribute 96
Creating a custom ActionResult 101
Creating a ViewEngine 105
Summary 113
Chapter 7: Using Existing ASP.NET Features 115
Session State 116
Reading and writing session data 116
Configuring session state 117
TempData 119
Membership, authentication, and authorization 120
Configuring web site security 121
Implementing user and role based security in a controller 122
Configurable authentication options 125
Caching 127
Globalization 129
Resources 129
Using local resources 130
Using global resources 132
Setting language and culture preferences 132
Mixing ASP.NET Webforms and ASP.NET MVC 135
Plugging ASP.NET MVC into an existing ASP.NET application 135
Plugging ASP.NET into an existing ASP.NET MVC application 139
Sharing data between ASP.NET and ASP.NET MVC 140
Building views at compile time 142
Summary 143
Chapter 8: AJAX and ASP.NET MVC 145
Different AJAX frameworks 145
XMLHttpRequest 146
JavaScript Object Notation (JSON) 146
ASP.NET AJAX 147
ASP.NET MVC AJAX helper 147
Working with JsonResult 150
jQuery 152
jQuery syntax 153
Using jQuery with ASP.NET MVC 154
Working with JsonResult 157
Using jQuery UI 159
Summary 164
Chapter 9: Testing an Application 165
Unit testing 166
Unit testing frameworks 166
Hello, unit testing! 166
Generating unit tests 168
Testing the action method 170
Mocking frameworks 172
Testing the Login action method 174
Mocking ASP.NET components 176
Testing routes 178
Testing UpdateModel scenarios 179
Summary 182
Chapter 10: Hosting and Deployment 183
Platforms that can be used 183
Differences between IIS 7.0 integrated and classic mode 184
Hosting an ASP.NET MVC web application 186
Creating a wildcard script map in IIS 7.0 187
Creating a wildcard script map in IIS 6.0 188
Modifying the route table to use file extensions 189
Summary 191
Appendix A: Reference Application— CarTrackr 193
CarTrackr functionality 193
Home page 194
NVelocity view engine 230
Example ASP.NET MVC applications 230
MVC storefront 230
FlickrExplorer 230
Yonkly 231
Kigg 231
CarTrackr 231
Index 233
书名:ASP.NET MVC In Action
作者: Jeffrey Palermo , Ben Scheirman , Jimmy Bogard
出版社:Manning
目录:
Chapter 1: Getting started with the ASP.NET MVC Framework
Chapter 2: The Model in depth
Chapter 3: The Controller in depth
Chapter 4: Views in depth
Chapter 5: Routing
Chapter 6: Customizing and extending the ASP.NET MVC Framework
Chapter 7: Scaling the architecture to more complex sites
Chapter 8: Leveraging existing ASP.NET features
Chapter 9: AJAX in ASP.NET MVC
Chapter 10: Hosting and deployment
Chapter 11: Exploring MonoRail and Ruby on Rails
Chapter 12: Best practices Chapter 13: Recipes