MVC 动态加载的模态形式在本地工作但不在生产中工作

MVC dynamically loaded modal form working locally but not working on production

我有模态弹出窗口 bootstrap 其内容由 ajax 加载以获取部分视图。 它具有 Ajax.BeginForm 并在本地 IIS(v.10) 或开发环境中成功保存表单,但在生产服务器 (IIS v.8) 中它只验证表单而不是 post 表单。 chrome 控制台中未出现客户端错误 出了什么问题?

布局

<script src="../scripts/jquery.validate.min.js"></script>
<script src="../scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="../scripts/jquery.unobtrusive-ajax.min.js"></script>

web.config

<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

局部视图

@{
        Layout = null;
    }
    @model SMSAPI.Models.Group

    <div class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Groups</h5>
                </div>
                @using (Ajax.BeginForm("Save", "Groups",
                      new AjaxOptions
                      {
                          OnSuccess = "AfterAjaxSuccess();",
                          OnFailure = "AfterAjaxFailure();",
                          HttpMethod = "POST"
                      },
                      new { id = "form" }))
                {
                    @Html.HiddenFor(x => x.Group_ID)
                    @Html.HiddenFor(x => x.Created_By)
                    @Html.HiddenFor(x => x.Created_Date)
                    <div class="modal-body">
                        <div class="control-group ">
                            @Html.LabelFor(x => x.Group_Code)
                            <span class="help">"use chars, numbers, special chars"</span>
                            <div class="col-md-6 col-sm-12">
                                @Html.TextBoxFor(x => x.Group_Code, new { @class = "form-control " })
                                @Html.ValidationMessageFor(x => x.Group_Code, "", new { @class = "text-danger" })
                            </div>
                        </div>
                        <div class="control-group ">
                            @Html.LabelFor(x => x.Group_Name)
                            <span class="help">e.g. "Managers, Supervisors and Salespersons etc"</span>
                            <div class="col-md-6 col-sm-12">
                                @Html.TextBoxFor(x => x.Group_Name, new { @class = "form-control " })
                                @Html.ValidationMessageFor(x => x.Group_Name, "", new { @class = "text-danger" })
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-success btn-ef btn-ef-3 btn-ef-3c" id="myModalSaveBtn" guid="" type="submit"><i class="fa fa-arrow-left"></i> Save</button>
                        <button class="btn btn-lightred btn-ef btn-ef-4 btn-ef-4c" data-dismiss="modal"><i class="fa fa-arrow-left"></i> Cancel</button>
                    </div>
                }
            </div>
        </div>
    </div>
    <script src="../scripts/jquery.validate.min.js"></script>
    <script src="../scripts/jquery.validate.unobtrusive.min.js"></script>

[解决方案] 我明白为什么了

生产服务器不允许 web 服务的 http get 和 post 只需添加

<webServices>
    <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
    </protocols>
</webServices>

 <system.web>