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()); 

  • 相关阅读:
    项目包结构
    准备dbcp2-2.1.1和pool2-2.4.2 、commons-dbcp-1.4jar包
    导入javax.servlet。伺服登记无法解决:The import javax.servlet.MultipartConfigElement cannot be resolved
    准备mysql-connector-java
    准备mybatis-spring
    准备spring
    准备MyBatis
    vim编辑器使用
    jquery怎样做出分页效果
    快速入门系列--WCF--02消息、会话与服务寄宿
  • 原文地址:https://www.cnblogs.com/andycai/p/1856834.html
Copyright © 2011-2022 走看看