文件名称:
ASP.NET_MVC_Step_by_Step中文版.pdf
开发工具:
文件大小: 4mb
下载次数: 0
上传时间: 2010-09-01
详细说明: 目 录 创建MVC Web Application ........................................................................................................................... 4 检查NerdDinner 项目的目录结构 ..................................................................................................... 5 运行NerdDinner 应用程序 ................................................................................................................. 8 测试NerdDinner 应用程序 ......................................................................................................... ...... 10 创建数据库 ................................................................................................................................................ 10 设置表之间的外键关系 ..................................................................................................................... 12 增加数据到Dinners 数据表 ............................................................................................................... 13 创建Model 模型 ........................................................................................................................................ 13 LINQ to SQL ......................................................................................................................................... 14 控制器和视图(Controllers and Views) .................................................................................................. 25 添加DinnersController 控制器 .......................................................................................................... 25 理解ASP.NET MVC Routing ................................................................................................................. 27 在DinnersController 控制器中使用DinnerRepository ..................................................................... 29 控制器Controller 使用视图Views .................................................................................................... 30 实现NotFound 视图模板 ................................................................................................................... 31 实现Details 视图模板 ........................................................................................................................ 33 实现Index 视图模板 .......................................................................................................................... 38 命名规范和\Views 目录结构 ............................................................................................................. 42 创建、更新、删除记录 ............................................................................................................................. 44 实现HTTP-GET 编辑Action 方法 ...................................................................................................... 45 Html.BeginForm() 和 Html.TextBox() HTML 辅助方法 ..................................................................... 49 实现HTTP-POST 的Edit Action 方法 ................................................................................................. 50 获取表单提交的值 ............................................................................................................................. 51 处理编辑异常 .................................................................................................................................... 53 理解ModelState 和验证HTML 辅助方法 ........................................................................................ 54 Html 辅助方法和ModelState 集成................................................................................................... 55 完成Edit Action 方法的实现 .............................................................................................................. 57 实现HTTP-GET 的Create Action 方法 ............................................................................................... 58 实现HTTP-POST 的Create Action 方法 ............................................................................................ 61 实现HTTP-GET 的Delete Action 方法 ............................................................................................... 63 实现HTTP-POST Delete Action 方法 .................................................................................................. 65 模型绑定的安全性 .................................................................................................................................... 66 基于用途来锁定绑定 ......................................................................................................................... 67 基于类型来锁定绑定 ......................................................................................................................... 67 CRUD 封装 .......................................................................................................................................... 68 ViewData 和ViewModel ............................................................................................................................. 70 从Controller 传递数据到View 视图模板 ......................................................................................... 71 使用ViewData 字典 ........................................................................................................................... 71 使用ViewModel 模式 ......................................................................................................................... 73 定制ViewModel 类(Custom-shaped ViewModel Classes) ............................................................ 76 Partials 和Master 页面 ............................................................................................................................... 76 使用Partial 视图模板 ........................................................................................................................ 76 使用Partial 视图模板简化代码 ........................................................................................................ 79 ASP.NET MVC Framework Step by Step 中文版 http://www.agiledon.com 制作; 本中文版来源于http://blog.entlib.com/entlibforum/Default.aspx; AgileDon 修订排版 Master 页面 ....................................................................................................................................... 80 分页 .................................................................................................................................................... 84 认证和授权 ................................................................................................................................................ 91 理解认证和授权 ................................................................................................................................ 91 Forms Authentication 和AccountController ....................................................................................... 91 使用[Authorize]过滤器对/Dinners/Create 授权 ................................................................................ 94 创建Dinners 时,使用User.Identity.Name 属性 ............................................................................. 95 在编辑Dinners 记录时,使用User.Identity.Name 属性 ................................................................. 96 显示/隐藏编辑和删除链接 ................................................................................................................ 98 AJAX 实现RSVP 响应 ................................................................................................................................. 99 显示用户是否已经回复了 ................................................................................................................. 99 实现Register Action 方法 ................................................................................................................. 101 使用AJAX 调用Register Action 方法 ............................................................................................... 101 添加jQuery 动画 .............................................................................................................................. 103 简化-重构RSVP Partial 视图 ............................................................................................................ 105 集成AJAX 地图 ........................................................................................................................................ 106 创建Map Partial 视图 ..................................................................................................................... 106 创建一个Map.js 工具类库 ............................................................................................................. 107 集成地图到创建和编辑表单 ........................................................................................................... 109 集成地图到Details 视图 .................................................................................................................. 113 在数据库和仓储中实现位置搜索 ................................................................................................... 114 实现基于JSON 的AJAX 搜索Action 方法 ....................................................................................... 118 使用jQuery 调用基于JSON 的AJAX 方法 ...................................................................................... 119 单元测试 .................................................................................................................................................. 122 为什么需要单元测试? ................................................................................................................... 122 NerdDinner.Tests 项目 ...................................................................................................................... 122 为Dinner 模型类创建单元测试 ...................................................................................................... 124 运行测试 .......................................................................................................................................... 127 创建DinnersController 单元测试 ................................................................................................... 127 依赖注入(Dependency Injection) ........................................................................................................ 129 提取IDinnerRepository 接口 ............................................................................................................ 129 更新DinnersController 支持构造器注入 ......................................................................................... 131 创建 FakeDinnerRepository 类 ........................................................................................................ 131 在单元测试中使用FakeDinnerRepository ....................................................................................... 134 创建Edit Action 方法的单元测试 .................................................................................................... 136 模仿User.Identity.Name 属性 .......................................................................................................... 137 测试UpdateModel() ......................................................................................................................... 139 单元测试总结 .................................................................................................................................. 141 NerdDinner 范例程序总结 ....................................................................................................................... 142 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.