MVC基架生成的Index视图
@model IEnumerable<MyMusicStore.Models.Album>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Artist.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Genre.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Title)
</th>
<th>
@Html.DisplayNameFor(model => model.Price)
</th>
<th>
@Html.DisplayNameFor(model => model.AlbumArtUrl)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Artist.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Genre.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
</td>
<td>
@Html.DisplayFor(modelItem => item.AlbumArtUrl)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.AlbumId }) |
@Html.ActionLink("Details", "Details", new { id=item.AlbumId }) |
@Html.ActionLink("Delete", "Delete", new { id=item.AlbumId })
</td>
</tr>
}
</table>
最新文章
- myString操作符重载
- 第25章 SEH结构化异常处理_未处理异常及向量化异常
- [iOS微博项目 - 2.5] - 封装授权和用户信息读写业务
- Android常用ProgressDialog设置
- Shell脚本:判断用户和用户组是否已经存在/创建用户和用户组
- Java语言跨平台原理
- Selenium webdriver定位iframe里面元素两种方法
- 使用CrashHandler来获取应用的crash信息
- 在Vuex使用 以及 dispatch和commit来调用mutations的区别
- 使用Coding体验小记
- 18.异常.md
- PhpStorm 配置本地断点调试
- e814. 创建一个可监听选择状态的菜单项
- 使用Salt-ssh部署Salt-minion之源码安装(二)
- myeclipse 10 j安装了JDK1.7,java编译器无法选择到1.7的问题
- JAVA项目-嗖嗖移动
- LoadRunner性能测试样例分析
- THUPC2017看题总结
- HDU 5754Life Winner Bo
- android开发小内容