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">,否则在处理服务器端控件的时候,会弹出新窗体!

  • 相关阅读:
    GRIDVIEW导出到EXCEL
    .NET GRIDVIEW导出EXCEL
    C#自动列宽
    vue 路由跳转及传值和取值
    vue 部署windows nginx服务上
    vue多个代理配置vue.config
    mock常用规则
    git基础篇-常见错误
    git基础篇-使用教程
    win10 gitserver搭建
  • 原文地址:https://www.cnblogs.com/xiaorong/p/1421534.html
Copyright © 2011-2022 走看看