Asp.net mvc 4 提交按钮在MVC4应用程序中的fancybox对话框中不执行任何操作

Asp.net mvc 4 提交按钮在MVC4应用程序中的fancybox对话框中不执行任何操作,asp.net-mvc-4,fancybox,forms,http-post,Asp.net Mvc 4,Fancybox,Forms,Http Post,目前,我们有一个编辑用户对话框(fancybox),它有一个链接,基本上用另一个fancybox对话框替换这个对话框来更改密码。在单击“更改密码”对话框上的“提交”按钮之前,一切似乎都正常运行。什么也没发生。我检查了fiddler,没有提出任何要求。我检查了Firefox,以验证更改密码控件实际上是用正确的表单标记包装的,并且它们是正确的。有什么好处?我通过网络查找了一些类似的问题,但没有一个使用MVC4,我也不太了解它们 这些fancybox模型是通过局部视图加载的。例如,打开第一个对话框的链

目前,我们有一个编辑用户对话框(fancybox),它有一个链接,基本上用另一个fancybox对话框替换这个对话框来更改密码。在单击“更改密码”对话框上的“提交”按钮之前,一切似乎都正常运行。什么也没发生。我检查了fiddler,没有提出任何要求。我检查了Firefox,以验证更改密码控件实际上是用正确的表单标记包装的,并且它们是正确的。有什么好处?我通过网络查找了一些类似的问题,但没有一个使用MVC4,我也不太了解它们

这些fancybox模型是通过局部视图加载的。例如,打开第一个对话框的链接只是一个链接,其中href=“EditUserPartialAction”。效果很好。由来自第一个模型的链接打开的模型也执行相同的操作,它只有一个href=“ChangePasswordPartialAction”。它装得很好。它只是一个按钮,没有任何作用

下面是正在生成的html。你可以看到表单看起来不错,应该可以工作(除非我忽略了什么)。再说一次,什么也没有发生。没有提出任何请求,更不用说错误了。“取消”按钮起作用,它只是将此对话框替换为上一个“编辑用户”对话框

<div class="fancybox-wrap fancybox-desktop fancybox-type-ajax fancybox-opened" tabindex="-1" style="width: 533px; height: auto; position: fixed; top: 20px; left: 685px; opacity: 1; overflow: visible;">
    <div class="fancybox-skin" style="padding: 15px; width: auto; height: auto;">
        <div class="fancybox-outer">
            <div class="fancybox-inner" style="overflow: auto; width: 503px; height: 279px;">
                <div id="modal-page">
                    <h1>Change Password</h1>
                    <form method="post" action="/AccountUser/ChangePassword?userId=0">
                        <div class="field_wrapper password">
                            <label for="NewPassword">NewPassword</label>
                            <input id="NewPassword" type="password" placeholder="Password" name="NewPassword">
                        </div>
                        <div class="field_wrapper password">
                            <label for="ConfirmPassword">ConfirmPassword</label>
                            <input id="ConfirmPassword" type="password" placeholder="Confirm Password" name="ConfirmPassword">
                        </div>
                        <div class="field_wrapper submit">
                            <a class="close_modal gradient change-password" href="/AccountUser/EditUserPartial?userId=0">Cancel</a>
                            <input class="gradient" type="submit" value="Change" name="update"/>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    <a class="fancybox-item fancybox-close" href="javascript:;" title="Close"></a>
    </div>
</div>
//plugins.js

// Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

// Place any jQuery/helper plugins in here.

我不认为这是你的
标签没有关闭的结果,是吗<代码>不,对不起。这被从粘贴中删掉了,这将是一个简单的修复:P如果MVC甚至不生成请求,我怀疑它与MVC有任何关系。fancybox插件是否可能取消表单提交?我不这么认为。即使是这样,我也想不出为什么它会在这里而不是其他地方引起问题?与相关选择器等的绑定
// Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = (window.console = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;
        }
    }
}());

// Place any jQuery/helper plugins in here.