没有合适的资源?快使用搜索试试~ 我知道了~
首页2013年Apress专业ASP.NET MVC 4框架详解
2013年Apress专业ASP.NET MVC 4框架详解
![](https://csdnimg.cn/release/wenkucmsfe/public/img/star.98a08eaa.png)
"Apress.Pro.ASP.NET.MVC.4.Framework.Jan.2013"是一本由Adam Freeman撰写的专业书籍,专注于ASP.NET MVC 4框架的高级教程。该书于2013年1月发布,旨在为开发人员提供深入理解和实践ASP.NET MVC 4的最佳实践和架构。作为第4版的“Pro ASP.NET MVC”,它覆盖了当时最前沿的技术,包括但不限于控制器设计、视图模板、路由配置、模型绑定、视图引擎、以及MVC的核心理念,如分离关注点和分层架构。 作者Adam Freeman以其丰富的经验和深入浅出的讲解风格闻名,本书提供了大量的实例和案例研究,帮助读者从入门到精通这个流行的Web开发框架。书中不仅涵盖了基础概念,还涵盖了更复杂的主题,如单元测试、依赖注入、以及如何利用ASP.NET MVC 4的新特性优化应用程序性能和用户体验。 版权方面,所有内容受法律保护,复制或传播需遵循版权法,并需获得Springer出版社的明确许可。对于非商业用途的摘录,如学术评论或供计算机系统使用的特定材料,必须在版权许可范围内操作,并通过Copyright Clearance Center的RightsLink或其他授权途径获取许可。 这本书是开发ASP.NET MVC 4项目的开发人员必备参考资料,无论你是初学者还是经验丰富的开发者,都可以从中收获大量实用的知识和技能提升。通过阅读和实践书中的内容,读者可以更好地理解和掌握ASP.NET MVC 4框架,为其Web应用开发项目奠定坚实的基础。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/6274515/bg10.jpg)
CONTENTS ■
xvii
Creating the Example Project ................................................................................. 511
Creating Custom Helper Methods ........................................................................... 513
Creating an Inline Helper Method .................................................................................. 513
Creating an External Helper Method .............................................................................. 515
Managing String Encoding in a Helper Method ............................................................. 518
Using the Built-In Form Helper Methods ................................................................ 523
Creating Form Elements ................................................................................................ 523
Specifying the Route Used by a Form ............................................................................ 530
Using Input Helpers ........................................................................................................ 532
Creating Select Elements ............................................................................................... 537
Summary ................................................................................................................ 539
■
Chapter 20: Templated Helper Methods ................................................................. 541
Reviewing the Example Project .............................................................................. 541
Using Templated Helper Methods ........................................................................... 543
Generating Label and Display Elements ........................................................................ 547
Using Whole-Model Template Helpers ........................................................................... 550
Using Model Metadata ............................................................................................ 552
Using Metadata to Control Editing and Visibility ............................................................ 553
Using Metadata for Labels ............................................................................................. 555
Using Metadata for Data Values .................................................................................... 557
Using Metadata to Select a Display Template ............................................................... 559
Applying Metadata to a Buddy Class ............................................................................. 561
Working with Complex Type Properties ......................................................................... 562
Customizing the Templated View Helper System ................................................... 564
Creating a Custom Editor Template ............................................................................... 564
Creating a Generic Template ......................................................................................... 565
Replacing the Built-in Templates ................................................................................... 566
Summary ................................................................................................................ 567
■
Chapter 21: URL and Ajax Helper Methods ............................................................. 569
Reviewing and Preparing the Example Project ...................................................... 569
Creating Basic Links and URLs ............................................................................... 571
Using MVC Unobtrusive Ajax .................................................................................. 573
Creating the Synchronous Form View ............................................................................ 574
Preparing the Project for Unobtrusive Ajax .................................................................... 575
![](https://csdnimg.cn/release/download_crawler_static/6274515/bg11.jpg)
■ CONTENTS
xviii
Creating an Unobtrusive Ajax Form ........................................................................ 577
Preparing the Controller ................................................................................................. 577
Creating the Ajax Form .................................................................................................. 578
Understanding How Unobtrusive Ajax Works ................................................................ 580
Setting Ajax Options ............................................................................................... 581
Ensuring Graceful Degradation ...................................................................................... 581
Providing the User with Feedback While Making an Ajax Request ................................ 583
Prompting the User Before Making a Request ............................................................... 584
Creating Ajax Links ................................................................................................ 585
Ensuring Graceful Degradation for Links ....................................................................... 587
Working with Ajax Callbacks .................................................................................. 587
Working with JSON ................................................................................................. 590
Adding JSON Support to the Controller .......................................................................... 590
Processing JSON in the Browser ................................................................................... 591
Preparing Data for Encoding .......................................................................................... 593
Detecting Ajax Requests in the Action Method .............................................................. 595
Summary ................................................................................................................ 598
■
Chapter 22: Model Binding ..................................................................................... 599
Preparing the Example Project ............................................................................... 599
Understanding Model Binding ................................................................................ 601
Using the Default Model Binder .............................................................................. 603
Binding to Simple Types ................................................................................................ 603
Binding to Complex Types ............................................................................................. 607
Binding to Arrays and Collections .................................................................................. 614
Manually Invoking Model Binding .......................................................................... 619
Dealing with Binding Errors ........................................................................................... 621
Customizing the Model Binding System ................................................................. 621
Creating a Custom Value Provider ................................................................................. 622
Creating a Custom Model Binder ................................................................................... 625
Registering the Custom Model Binder ........................................................................... 627
Summary ................................................................................................................ 628
■
Chapter 23: Model Validation ................................................................................. 629
Creating the Example Project ................................................................................. 629
Explicitly Validating a Model .................................................................................. 631
![](https://csdnimg.cn/release/download_crawler_static/6274515/bg12.jpg)
CONTENTS ■
xix
Displaying Validation Errors to the User ........................................................................ 633
Displaying Validation Messages ............................................................................. 634
Displaying Property-Level Validation Messages ............................................................ 638
Using Alternative Validation Techniques ................................................................ 639
Performing Validation in the Model Binder .................................................................... 639
Specifying Validation Rules Using Metadata ................................................................. 641
Defining Self-Validating Models .................................................................................... 647
Performing Client-Side Validation .......................................................................... 649
Enabling and Disabling Client-Side Validation ............................................................... 649
Using Client-Side Validation .......................................................................................... 650
Understanding How Client-Side Validation Works ......................................................... 652
Performing Remote Validation ............................................................................... 653
Summary ................................................................................................................ 656
■
Chapter 24: Bundles and Display Modes ................................................................ 657
Understanding the Default Script Libraries ............................................................ 657
Preparing the Example Application ........................................................................ 659
Managing Scripts and Style Sheets ........................................................................ 662
Profiling Script and Style Sheet Loading ....................................................................... 662
Using Script and Style Bundles .............................................................................. 664
Applying Bundles ........................................................................................................... 667
Using the Scripts Section ............................................................................................... 669
Profiling the Changes ..................................................................................................... 670
Targeting Mobile Devices ....................................................................................... 673
Taking Stock of the Application ..................................................................................... 673
Using Mobile Specific Layouts and Views ..................................................................... 674
Creating Custom Display Modes .................................................................................... 676
Summary ................................................................................................................ 678
■
Chapter 25: Web API ............................................................................................... 679
Understanding the Web API .................................................................................... 679
Creating the Web API Application ........................................................................... 680
Creating the Model and Repository ................................................................................ 680
Creating the Home Controller ........................................................................................ 682
Creating the View and the CSS ...................................................................................... 683
Creating the API Controller ..................................................................................... 685
![](https://csdnimg.cn/release/download_crawler_static/6274515/bg13.jpg)
■ CONTENTS
xx
Testing the API Controller .............................................................................................. 687
Understanding How the API Controller Works ........................................................ 689
Understanding API Controller Action Selection .............................................................. 689
Mapping HTTP Methods to Action Methods ................................................................... 690
Writing the JavaScript Code to Use the Web API .................................................... 691
Creating the Basic Functionality .................................................................................... 692
Adding Support for Editing New Reservations ............................................................... 694
Adding Support for Deleting Reservations ..................................................................... 696
Adding Support for Creating Reservations ..................................................................... 697
Summary ................................................................................................................ 698
■
Chapter 26: Deployment ......................................................................................... 699
Preparing an Application for Deployment .............................................................. 700
Detecting View Errors .................................................................................................... 700
Disabling Debug Mode ................................................................................................... 702
Removing Unused Connection Strings ........................................................................... 703
Preparing Windows Azure ...................................................................................... 704
Creating the Web Site and Database ............................................................................. 705
Preparing the Database for Remote Administration ...................................................... 707
Creating the Schema ..................................................................................................... 708
Deploying the Application ...................................................................................... 710
Summary ................................................................................................................ 716
■
Index ....................................................................................................................... 717
![](https://csdnimg.cn/release/download_crawler_static/6274515/bg14.jpg)
xxi
About the Author
Adam Freeman
is an experienced IT professional who has held senior positions
in a range of companies, most recently serving as chief technology officer and
chief operating officer of a global bank. Now retired, he spends his time writing
and running.
剩余735页未读,继续阅读
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![tar](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
宁静致远1111
- 粉丝: 0
- 资源: 8
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 计算机人脸表情动画技术发展综述
- 关系数据库的关键字搜索技术综述:模型、架构与未来趋势
- 迭代自适应逆滤波在语音情感识别中的应用
- 概念知识树在旅游领域智能分析中的应用
- 构建is-a层次与OWL本体集成:理论与算法
- 基于语义元的相似度计算方法研究:改进与有效性验证
- 网格梯度多密度聚类算法:去噪与高效聚类
- 网格服务工作流动态调度算法PGSWA研究
- 突发事件连锁反应网络模型与应急预警分析
- BA网络上的病毒营销与网站推广仿真研究
- 离散HSMM故障预测模型:有效提升系统状态预测
- 煤矿安全评价:信息融合与可拓理论的应用
- 多维度Petri网工作流模型MD_WFN:统一建模与应用研究
- 面向过程追踪的知识安全描述方法
- 基于收益的软件过程资源调度优化策略
- 多核环境下基于数据流Java的Web服务器优化实现提升性能
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)