zoukankan      html  css  js  c++  java
  • 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>
     

  • 相关阅读:
    HttpClientUtil的工具类请求三方API
    Linux下使用docker搭建ftp服务器
    Springboot2.0.4整合Mybatisplus
    Springboot前后端分离项目,配置跨域
    Nokia S40 系统配置
    "Your profile could not be opened correctly" Google Chromium Browser 错误纠正
    CLR AppDomain
    iTunes下载提速
    Which Programming Language?
    linux下制作软盘镜像文件
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434601.html
Copyright © 2011-2022 走看看