zoukankan      html  css  js  c++  java
  • 打开自适应子窗体,关闭子窗体刷新父窗体

    -

        很少使用window.open()方法。做了一个打开自适应子窗体,关闭子窗体刷新父窗体的DEMO。

        父窗体ParentWin.aspx

    Code

         ParentWin.aspx.cs  

         protected void Page_Load(object sender, EventArgs e)
        {
            txtBox.Text = System.DateTime.Now.ToString();//验证页面刷新
        }

    Code

         ChildWin.aspx.cs

         protected void btnCloseServer_onclick(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "error", "<script language='javascript'>alert('子窗口!');self_ReplaceParent(1);window.close();</script>");

        }

       可以再借助AJAX UpdatePanel,刷新父窗体的局部页面,给用户带来更好的体验。

     <打开模式窗体:window.showModalDialog('http://www.17vs.com',null,'toolbar=no,resizable=no,scrollbars=yes,location=no, status=no');">

    如果打开的是模式子窗体,要在子窗体的head标签里加上<base   target="_self">,否则在处理服务器端控件的时候,会弹出新窗体!

  • 相关阅读:
    Zookeeper入门
    Redis五种数据类型
    shardingJDBC分库分表
    RabbitMQ入门
    Spring-Boot
    spring-mvc
    oracle一些对表的操作命令
    对IFeatureClass的选择结果进行再次选择及排序
    关于基础 DBMS 错误 ORA-01654的总结
    Linq 如何实现 in 与 not in
  • 原文地址:https://www.cnblogs.com/xiaorong/p/1421534.html
Copyright © 2011-2022 走看看