• 模态对话框对父页面控件回写值


                父页面:
         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()); 

  • 相关阅读:
    《把时间当作朋友》读书笔记
    Oracle&SQLServer中实现跨库查询
    Android学习——界面互调2
    《IT不再重要》读后感
    Android学习——数据存储
    Android学习——编写菜单
    Android学习——后台程序
    Android学习——写个小实例
    Android学习——界面编程!
    深入理解JavaScript系列(42):设计模式之原型模式
  • 原文地址:https://www.cnblogs.com/andycai/p/1856834.html
Copyright © 2020-2023  润新知