Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.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
Javascript 为什么我的window.dialogArguments未定义_Javascript_Asp.net_Modal Dialog - Fatal编程技术网

Javascript 为什么我的window.dialogArguments未定义

Javascript 为什么我的window.dialogArguments未定义,javascript,asp.net,modal-dialog,Javascript,Asp.net,Modal Dialog,我需要在模式对话框中打开一个.aspx页面。下面是我用来打开对话框的JS代码: if (url) { var fullPath = url + "/Validation.aspx"; } else { alert("Could not find the location of the merge dialog. Please contact your System admin and have th

我需要在模式对话框中打开一个.aspx页面。下面是我用来打开对话框的JS代码:

        if (url) {
            var fullPath = url + "/Validation.aspx";
        }
        else {
            alert("Could not find the location of the merge dialog.  Please contact your System admin and have them update the configuration entity.");
            return;
        }

        var features = "unadorned:yes;scroll:yes;resizable:yes;status:yes;dialogHeight:480px;dialogWidth:480px;";

        var args = {
            selected: selectedIds,
            page: pageIds,
            fetchXml: xml,
            entity: "xyz"
        };

        window.showModalDialog(fullPath, args, features);
在我的validation.aspx页面中,我需要能够获取JS参数,将它们分配到隐藏字段,然后重新发布,这样我就可以在服务器端使用这些参数值

以下是我的.aspx页面中的JS代码:

window.onload = function(){        
    if (!window.dialogArguments)
        return;

        var args = window.dialogArguments;
        ...
}

我在网络上看到了大量这样的例子但是…我的window.dialogArguments在我的.aspx页面中始终未定义。有什么好处?有人有什么想法或解决方案吗?

我的假设是,正在跨域打开ASPX对话框页面

这意味着您的父页面位于一个域aka:
http://abc/page.html
,并且您的子对话框页面位于另一个域中,如:
http://def/dialog.html


如果是这种情况,似乎对访问dialogArguments和returnValue有限制。例如,查看上的注释。

ps:这是我在.aspx页面中的JS代码:当您尝试运行该代码时,会发生什么情况?代码片段位于文档头的底部…?aspx页面中的JS位于标题中。window.dialogArguments未定义,因此它只是从window.onload函数中返回。