Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 添加编辑表,如何将行更改为编辑模式?_C#_Jquery_Asp.net Mvc_Razor - Fatal编程技术网

C# 添加编辑表,如何将行更改为编辑模式?

C# 添加编辑表,如何将行更改为编辑模式?,c#,jquery,asp.net-mvc,razor,C#,Jquery,Asp.net Mvc,Razor,下面是我的razor代码,用于我的用户表和当前的添加/编辑布局 <table class="smalltable" cellpadding="0" cellspacing="0" id="tblUsers"> <thead> <tr> <th>&nbsp;</th> <th>First Name</th> &l

下面是我的razor代码,用于我的用户表和当前的添加/编辑布局

<table class="smalltable" cellpadding="0" cellspacing="0" id="tblUsers">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Dept</th>
            <th>Assyst Name</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>@{ Html.BeginForm("AddEditUser", "Home"); }
                 <input type="submit" value="Add" id="btnSave" name="cmd" class="plain-button" />
            </td>
            <td>@Html.Editor("Forename")</td>
            <td>@Html.Editor("Surname")</td>
            <td>@Html.DropDownList("lstDepts")</td>
            <td>@Html.Editor("AssystName")
             @{ Html.EndForm(); }</td>
        </tr>
        @foreach (var User in Model)
        {
            <tr>
                <td>@Html.ActionLink("Edit", "AddEditUser", new { id = User.ID }, new { name = "cmd", value = "Edit" })</td>
                <td>
                    @User.Forename
                </td>
                <td>
                    @User.Surname
                </td>
                <td>
                    @User.Dept
                </td>
                <td>
                    @User.AssystName
                </td>
            </tr>
        }
    </tbody>
</table>
我想实现的是,当按下编辑按钮时,编辑链接所在的行变成编辑框,我想知道如何加载带有编辑用户详细信息的添加表单我可以使用隐藏id并使用querystring设置它,但我真的想就地编辑

有人知道怎么做或者能给我指出正确的地方吗


谢谢

对我来说太贵了requirements@AlexW,可以在每个单元格内呈现文本框。对它们设置readonly=readonly。单击后,您只需删除此属性并编辑数据。另一方面,考虑从FoeCH切换到如果您要将数据发布到服务器。