模态窗口无法刷新

需求:

主页面上点击选中物料按钮,弹出物料列表子窗口,双击具体记录,返回给主页面的物料文本框。

子窗口页面可输入物料号进行模糊查询及分页

问题:

在子窗口输入物料号,点击查询按钮后无反应。

问题分析

怀疑是缓存的问题[不是]

进行Debug,发现后台的代码及MVC页面代码都执行了,但页面就是没有变化,后在页面上添加<base target="_self" />后就可以了。

主页面代码:

 function ShowPn() {
        var m = window.showModalDialog("/Materials/MaterialsListForm", "dialogHeight:200px,center:yes,resizable:yes,status:no");  // m接受模态窗口的返回值,前台代码执行到这里开始等待模态窗口返回值再往下走。
            if (m != null) {
                //document.getElementById("MfgOrder_MaterialsEntity_ID").value = m.toString();
                $("#MfgOrder_MaterialsEntity_ID").attr("value", m.toString());
         }
    }

子页面代码:

 function ReturnPn(pn) {
        if (pn != "") {
                window.returnValue = pn;
                window.close();
           } else {
               alert("请选择物料");
           }
        }

子页面Html代码:

<head>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <title>物料基础数据【双击选择】</title>
 </head>
<base target="_self" />

猜你喜欢

转载自www.cnblogs.com/sportdog/p/12294812.html