js跳转页面回传值问题处理

母页面中

   

 string url = "../InquiryStores/Maintain.aspx?dt=" + DateTimeUtility.getSystemTime2(null);
        string script = "var returnVar =window.showModalDialog(\"" + url + "\", null, \"dialogWidth:800px; dialogHeight:360px;status:no;help:yes\");" +
     "if (typeof(returnVar)!= 'undefined') {";

        script += "var array=new Array();";

        script += "array=returnVar.split('Ω');";

        script += "document.getElementById('S_" + sfYAA001To.ClientID + "').value=array[1];";

        script += "document.getElementById('S_" + sfYAA001To.ClientID + "').focus();";

        script += "}";

        executeScript(script);

执行这段js,会弹出窗体画面

子页面中

   string returnValue = objects.getData("GUID");
        returnValue += "Ω" + objects.getData("YAA001");
        returnValue += "Ω" + objects.getData("YAA002");
        returnValue += "Ω" + objects.getData("YAA003");
        returnValue += "Ω" + objects.getData("YAA009");
        returnValue += "Ω" + objects.getData("YAA013");
        returnValue += "Ω" + objects.getData("YAA014");
        returnValue += "Ω" + objects.getData("YAA016");
        returnValue += "Ω" + objects.getData("YAA017");
        returnValue += "Ω" + objects.getData("YAA010");
        Response.Write("window.close();");
        //返回字符串,可以根据Ω来分隔字符串找到自己需要的值
        Response.Write("window.returnValue='" + returnValue + "';");

回传returnValue到母页面

posted on 2013-01-29 17:18  孟德思旧  阅读(1732)  评论(0编辑  收藏  举报