Week5(10月10日):国庆之后,让我们整装期待元旦吧
2014-10-07 15:24
197 查看
Part I:提问
===========================
1.要将“Hello, Admin",从控制器传递到视图,该如何操作?
(1)使用ViewData
(2)使用ViewBag
2.已知某学生类Student.cs,控制器中Index动作将学生传递给视图,请解释强类型传递的原理。
Part II:Ch03 视图3
===========================
要点:
1.知识点3-5:使用强类型模板
2.知识点3-6:HTML辅助方法
3.动手吧>>:在自己的大作业网站中,实现留言功能。要求如http://192.168.55.163/TakeLearning所示。
参考资料见教程,演练3-1:留言管理系统的制作;
该作业将在10月17日检查。
===========================
1.要将“Hello, Admin",从控制器传递到视图,该如何操作?
(1)使用ViewData
(2)使用ViewBag
2.已知某学生类Student.cs,控制器中Index动作将学生传递给视图,请解释强类型传递的原理。
public ActionResult Index() { return View(db.Students.ToList()); }
@model IEnumerable<tempPractice.Models.Student> @{ ViewBag.Title = "Index"; } <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table> <tr> <th> @Html.DisplayNameFor(model => model.Name) </th> <th> @Html.DisplayNameFor(model => model.StuNo) </th> <th> @Html.DisplayNameFor(model => model.Phone) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.Name) </td> <td> @Html.DisplayFor(modelItem => item.StuNo) </td> <td> @Html.DisplayFor(modelItem => item.Phone) </td> <td> @Html.ActionLink("Edit", "Edit", new { id=item.Id }) | @Html.ActionLink("Details", "Details", new { id=item.Id }) | @Html.ActionLink("Delete", "Delete", new { id=item.Id }) </td> </tr> } </table>
Part II:Ch03 视图3
===========================
要点:
1.知识点3-5:使用强类型模板
2.知识点3-6:HTML辅助方法
3.动手吧>>:在自己的大作业网站中,实现留言功能。要求如http://192.168.55.163/TakeLearning所示。
参考资料见教程,演练3-1:留言管理系统的制作;
该作业将在10月17日检查。
相关文章推荐
- 360VsQQ之后,我们该做点什么
- 寻找创业人到成都一起创业,一起努力实现我们心中期待的梦想!
- 国庆放假,买票回家,我们一起来看看12306的那些事儿
- Facebook和Twitter之后 我们用什么?
- 我们在这里期待~~
- 我们期待自己成为一个优秀的软件模型设计者(转载)
- 16天狂欢之后,生活回到常态,我们面对的是严峻的经济形势。
- C++数据与我们转移过空间之后
- 除了大牌旗舰,MWC上还有这些更值得我们期待
- [欢度国庆]为什么我们今天还要学习和使用C++?(转载)
- UISegmentedControl好多属性设置在iOS7.0之后都失去了失效---也就是“过期了”! iOS7.0之后我们可以用以下方法!
- 我们期待自己成为一个优秀的软件模型设计者
- 【聘】一分耕“云”,Double收获,我们就是你期待的样子...
- 风往哪个方向吹,草就要往哪个方向倒。年轻的时候我也觉得自己是风,到处追逐梦想。但被碰的头碰血流之后才明白,原来我们每个人都是草。
- 独家 | 火灾之后,我们能够利用大数据做些什么?
- 关于SpringMVC4使用过程中的路径问题,我们经常遇到的Controller未执行以及执行了之后出现404
- Ubuntu 11.04为何值得我们期待?
- 我们期待功能强大的ZoomLa! 逐浪CMS v3.0终于发布了
- 让我们期待日全食的降临
- 600万密码泄露之后,我们该如何保护自己的密码?