zoukankan      html  css  js  c++  java
  • 模态对话框对父页面控件回写值

                父页面:
         String url = "../Public/xxxx.aspx?";
                StringBuilder script = new StringBuilder();
                script.Append("<script language=javascript>window.showModalDialog('");
                script.Append(url);
                script.Append("'+'&tempRandom='+Math.random()");
                script.Append(",[document.getElementById('" + this.hdnIsOpen.ClientID + "')"); //回写值1,hdnIsOpen是server 端控件
                script.Append(",document.getElementById('" + this.hdnBu.ClientID + "')");  //回写值2
                script.Append(",document.getElementById('" + this.hdnOu.ClientID + "')]"); //回写值3
                script.Append(",'dialogHeight:500px;dialogWidth:900px');");
                script.Append("</script>");
         Page.RegisterStartupScript("ShowBuOu", script.ToString());

                弹出模态对话框页面:点确认回写值,关闭
                    StringBuilder sb = new StringBuilder();
                    sb.Append("<script language=javascript>");
                    sb.Append("dialogArguments[0].value='N';"); // dialogArguments[0]这是传过来的参数hdnIsOpen,可以对它做作
                    sb.Append("dialogArguments[1].value='" + bu + "';");
                    sb.Append("dialogArguments[2].value='" + ou + "';");               
                    sb.Append("window.close();");
                    sb.Append("</script>");
                   
                    this.ClientScript.RegisterStartupScript(this.GetType(), "Show", sb.ToString()); 

  • 相关阅读:
    hdu4725 The Shortest Path in Nya Graph
    poj2679 Adventurous Driving 最短路
    线段树完全版【代码集合
    LCS!LCS!
    bzoj2763: [JLOI2011]飞行路线
    bzoj3389: [Usaco2004 Dec]Cleaning Shifts安排值班
    [ 浙江大学 数据库系统原理 ] [ MiniSQL ]课程设计
    [ 浙江大学 程序设计专题 ] 四个专题代码 报告 PPT共享
    [ C语言 ] 迷宫 迷宫生成器 [ 递归与搜索 ]
    [ C语言版 ] 数独计算器 [ 搜索剪枝法 ]
  • 原文地址:https://www.cnblogs.com/andycai/p/1856834.html
Copyright © 2011-2022 走看看