Views/User/Index.cshtml

(完整代码) 1KB

@model IEnumerable<WebApplication1.Models.Entities.User>

@{
    ViewBag.Title = "用户管理";
}

<h2>用户管理</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.UserPassword)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.UserPassword)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.UserId }) |
            @Html.ActionLink("Details", "Details", new { id=item.UserId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.UserId })
        </td>
    </tr>
}

</table>
<form action="~/User/Search" method="post">
    用户名:<input type="text" name="key" />
    <input type="submit" value="查询" />
</form>

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。