Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.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
使用jquery模态对话框_Jquery_Asp.net Mvc - Fatal编程技术网

使用jquery模态对话框

使用jquery模态对话框,jquery,asp.net-mvc,Jquery,Asp.net Mvc,我开始使用模态对话框;我通过阅读代码,并在少数人的帮助下创建了此代码 $('Form').submit(function(e) { var url = "controllers/EntradaPedidos"; var dialog = $("#dialog"); if ($("#dialog").length == 0) { d

我开始使用模态对话框;我通过阅读代码,并在少数人的帮助下创建了此代码

$('Form').submit(function(e) {
                    var url = "controllers/EntradaPedidos";
                    var dialog = $("#dialog");
                    if ($("#dialog").length == 0) {
                        dialog = $('<div id="dialog" style="display:hidden"> Los datos ingresados son:</div>').appendTo('body');
                    }
                    dialog.load(
                    url,
                    {}, // omit this param object to issue a GET request instead a POST request, otherwise you may provide post parameters within the object
                    function(responseText, textStatus, XMLHttpRequest) {
                        dialog.dialog({
                            close: function(event, ui) {
                                dialog.remove();
                            },
                            modal: true,
                            buttons: {
                                Si: function() {
                                    $(this).dialog("close");
                                    //EntradaPedidosProducto('Form');
                                },
                                No: function() {
                                    $(this).dialog("close");
                                }
                            },
                            width: 460,
                            resizable: true
                        });
                    }
                );
                    return false;
                });



  <div id="dialog" title="Datos Cliente:" style="display: none;">
    <p>
        <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
        Estos son los datos que ingreso:
    </p>
    <p>
        Desea Continuar?
    </p>
如果用户按yes(si),我想更改窗口

我是怎么做到的

最后,如何在模态对话框上推送表单的数据

Si : function(){
  $(this).dialog("close");
   window.location = "/"+url;
}
将名为“controllers”的控制器中名为“EntradaPedidos”的actionMethodof的url设置为名为“url”的javascript变量。此url将在dialog.load方法中使用。(对话框将加载从执行此操作方法收到的内容)

如果要保存该值,请在此处执行

 Si: function() {
                    //Read data and Save to DB using an ajax call
                },

您想继续执行程序是什么意思?切换到下一个窗口,获取此窗口的值(表单值)并在下一个窗口中使用它表单的值会发生什么情况?我可以在下一个窗口中使用它?我需要两个窗口(表单)的数据,然后才能保存到数据库中。您应该能够使用javascript访问它。
Si : function(){
  $(this).dialog("close");
   window.location = "/"+url;
}
 var url = "controllers/EntradaPedidos";
 Si: function() {
                    //Read data and Save to DB using an ajax call
                },