• ASP.Net 显示


    @model IEnumerable<G6.Model.UserModel>

    @{
    Layout = null;
    }

    <!DOCTYPE html>

    <html>
    <head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    </head>
    <body>
    <p>
    <a asp-action="Create">Create New</a>
    </p>
    <table class="table">
    <thead>
    <tr>
    <th>
    @Html.DisplayNameFor(model => model.UId)
    </th>
    <th>
    @Html.DisplayNameFor(model => model.LoginName)
    </th>
    <th>
    @Html.DisplayNameFor(model => model.LoginPwd)
    </th>
    <th>
    @Html.DisplayNameFor(model => model.UName)
    </th>
    <th></th>
    </tr>
    </thead>
    <tbody>
    @foreach (var item in Model) {
    <tr>
    <td>
    @Html.DisplayFor(modelItem => item.UId)
    </td>
    <td>
    @Html.DisplayFor(modelItem => item.LoginName)
    </td>
    <td>
    @Html.DisplayFor(modelItem => item.LoginPwd)
    </td>
    <td>
    @Html.DisplayFor(modelItem => item.UName)
    </td>
    <td>
    @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
    @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
    @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
    </td>
    </tr>
    }
    </tbody>
    </table>
    </body>
    </html>

    ADD


    @{
    Layout = null;
    }

    <!DOCTYPE html>

    <html>
    <head>
    <meta name="viewport" content="width=device-width" />
    <title>AddUser</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script>
    function AddUser() {
    var obj = {
    LoginName: $("#txt_loginName").val(),
    LoginPwd: $("#txt_loginPwd").val(),
    UName: $("#txt_Name").val()
    };
    $.ajax({
    url: "/User/AddUser",
    type: "post",
    dataType: "json",
    data: obj ,
    success: function (d) {
    if (d > 0) {
    alert("添加成功");
    }
    }
    })
    }
    </script>
    </head>
    <body>
    <div align="center">
    <table class="table table-bordered" style="40%;">
    <tr>
    <td>登录名:</td>
    <td><input id="txt_loginName" type="text" /></td>
    </tr>
    <tr>
    <td>密码:</td>
    <td><input id="txt_loginPwd" type="text" /></td>
    </tr>
    <tr>
    <td>用户姓名:</td>
    <td><input id="txt_Name" type="text" /></td>
    </tr>
    <tr>
    <td colspan="2"><input id="btn_Save" type="button" class="btn btn-primary" value="提交" onclick=" AddUser();" /></td>
    </tr>
    </table>
    </div>

    </body>
    </html>

  • 相关阅读:
    《操作系统真象还原》bochs安装
    容量限制的设施位置问题
    Python1 关于安装
    分层测试
    理解 Apache与Tomcat
    CSPS Day1 T1 格雷码
    快速幂+龟速乘+费马小定理+逆元+矩阵乘法
    P2261 [CQOI2007]余数求和
    MySQL源码:Innobase字典管理及索引
    一致代码段和非一致代码段
  • 原文地址:https://www.cnblogs.com/XJNB/p/13150379.html
Copyright © 2020-2023  润新知