(1)@Html.DisplayNameFor(model => model.Title)是显示列名,

(2)@Html.DisplayFor(modelItem => item.Title)是显示列的内容

(3)@Html.ActionLink("Create New", "Create")是超链接,跳转到model中的create页面,引用的是controller中create方法;

(4)@Html.ActionLink("Edit", "Edit", new { id=item.ID })编辑页面;

(5)@using (Html.BeginForm()) {   @Html.ValidationSummary(true)}用于客户端验证,其Html.BeginForm()表示在本页显示

(6)<div class="editor-label">
@Html.LabelFor(model => model.Time)标签
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Time)编辑框
@Html.ValidationMessageFor(model => model.Time)验证合法性错误显示
</div> @model IEnumerable<MvcMovie.Models.Movie>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
@using (Html.BeginForm("Index", "Movies", FormMethod.Get))
{
<p>
Genre: @Html.DropDownList("movieGenre", "All")
Title: @Html.TextBox("SearchString")
<input type="submit" value="Filter" />
</p>
}
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Title)
</th>
<th>
@Html.DisplayNameFor(model => model.ReleaseDate)
</th>
<th>
@Html.DisplayNameFor(model => model.Genre)
</th>
<th>
@Html.DisplayNameFor(model => model.Price)
</th>
<th>
@Html.DisplayNameFor(model => model.Rating)
</th> <th></th>
</tr> @foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReleaseDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.Genre)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rating)
</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>

最新文章

  1. CPU中断和轮询
  2. 12月6日PHPCMS取内容发布管理中的来源
  3. Git代码管理工具
  4. The import java.util cannot be resolved The import javax.servlet cannot be resolved
  5. python成长之路【第四篇】:装饰器
  6. IOS学习笔记之 Socket 编程
  7. Ajax 学习之创建XMLHttpRequest对象------Ajax的核心
  8. 经典线程同步 互斥量Mutex
  9. Env:VIM配置
  10. Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载
  11. gulp自动化框架的搭建
  12. 几个国外FMX网站 good
  13. 《Java编程思想》读书笔记-基本规范、注释、static关键字、import关键字
  14. Oracle merge合并更新函数
  15. [蛙蛙推荐]SICP第一章学习笔记-编程入门
  16. BZOJ3655 : 神经错乱数
  17. django-ajax post与get请求
  18. Zabbix配置参数优化
  19. CSS计数器(序列数字字符自动递增)详解———张鑫旭
  20. 关于bootstrap的treeview不显示多选(复选框)的问题,以及联动选择的问题,外加多选后取值

热门文章

  1. velocity 遍历EventHandler Iterator
  2. python面向对象(一)
  3. DOM 常见事件
  4. Linux中的预定义变量
  5. 0403-服务注册与发现-客户端负载均衡-Ribbon的基本使用
  6. python 使用pip install 手动安装本地包的方法
  7. ACM解题之回文序列
  8. eval in Shell
  9. xml转换为对象 微信接口
  10. &lt;script&gt;放在head内和body内有什么区别