提交时,iframe内的表单不起作用

时间:2018-06-11 12:52:54

标签: asp.net-mvc

你好,抱歉打扰了。我有一个问题。我有这个用户视图的列,左栏会显示用户列表,点击用户后,右侧会在iframe中打开另一个视图,里面有一个表单。

enter image description here 如果我做了我想要的更改,然后按表单提交按钮(保存)它会给我这个错误:

enter image description here

完整视图的代码是:

<div style="align-content:center">
                    <div class="row" style="height:500px;">
                        <div class="col-sm-6">
                            <table border="1" align="center" style="margin-top:0px;">
                                <tr>
                                    <th>User List</th>
                                    <th style="text-align:center;">Active</th>
                                </tr>

                                @foreach (var member in members)
                                {
                                    var memberID = Int32.Parse(member.GetProperty("memberTypeID").ToString());
                                    var ApprovedMember = ApplicationContext.Services.MemberService.GetById(memberID).IsApproved;

                                    <tr>
                                        <td>
                                            <a style="text-decoration: underline;" href="@Url.Action("UserManageView", "AccountSurface", new { id = member.Id })" target="liqManaging">
                                                <span>@member.Name</span>
                                            </a>
                                        </td>

                                        @if (ApprovedMember)

                                        {
                                            <td align="center">Yes</td>
                                        }
                                        else
                                        {
                                            <td align="center">No</td>
                                        }
                                    </tr>
                                }
                            </table>
                        </div>
                        <div name="liqManaging" class="col-sm-6">
                            <iframe name="liqManaging" runat="server"></iframe>
                        </div>
                    </div>

iframe表单的代码是:

<body style="padding-top:0px;">
@using (Html.BeginUmbracoForm<AccountSurfaceController>("ManageUsers", null, new { id = "UserManageForm", enctype = "form-data" }))
{
    <input type="hidden" id="member" name="member" value="@userID" />

    <table>
        <tr>
            <th>User selected</th>
            <th style="text-align:center;">Actions</th>
        </tr>
        <tr>
            <td>
                @memberContentNode.Name.ToString()
            </td>
            <td align="center">
                @{
                    if (!ApprovedMember)
                    {
                        using (Html.BeginForm("ResendActivationNotificationForLiqAdmin", "Registration", new { id = "userResendActivationForm" }, FormMethod.Post, new { style = "display:inline" }))
                        {
                            <input type="hidden" id="Key" name="Key" value="@memberKey" />
                            <input type="hidden" id="memberEmail" name="memberEmail" value="@memberEmail" />
                            <button class="btn-primary" type="submit" style="display:inline-block">Resend activation e-mail</button>
                        }
                    }

                    using (Html.BeginUmbracoForm<AccountSurfaceController>("DeleteUser", null, new { id = "userDeleteForm", style = "display:inline" }, FormMethod.Post))
                    {
                        <input type="hidden" id="memberNodeId" name="memberNodeId" value="@memberID" />
                        <button class="btn-primary" id="memberEmail" name="memberEmail" value="@memberEmail" style="display:inline-block">DELETE</button>
                    }
                }
            </td>
        </tr>
        <tr>
            <td>
                Save Changes
            </td>
            <td>
                <button id="submit" name="submit" value="">Save</button>
            </td>
        </tr>
    </table>

    <table border="1" style="margin-top:20px;" align="right">
        <tr>
            <th>
                <input type="checkbox" id="assignedCheckAll" value="check all" />
                Liquidation(s) managing
            </th>
        </tr>

        @foreach (var liquidation in liquidations)
        {
            if (memberAssignLiquidations.Contains(liquidation.Id.ToString()))
            {
                <tr>
                    <td>
                        <input type="checkbox" id="assignedLiqs" name="assignedLiqs" value="@liquidation.Id" />
                        <a href="@liquidation.NiceUrl">@liquidation.Name</a>
                    </td>
                </tr>
            }
        }
    </table>

    <table border="1" style="margin-top:20px;" align="right">
        <tr>
            <th>
                <input type="checkbox" id="availableCheckAll" />
                Available Liquidation(s)
            </th>
        </tr>

        @foreach (var liquidation in liquidations)
        {
            if (!memberAssignLiquidations.Contains(liquidation.Id.ToString()))
            {
                <tr>
                    <td>
                        <input type="checkbox" id="availableLiqs" name="availableLiqs" value="@liquidation.Id" />
                        <a href="@liquidation.NiceUrl">@liquidation.Name</a>
                    </td>
                </tr>
            }
        }
    </table>
}

问题是:有没有办法让这项工作或是否有替代iframe?

感谢所有人的时间,并抱歉(可能)愚蠢的问题!

0 个答案:

没有答案