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

  • 相关阅读:
    NSWindow,一些有的沒的
    IT单身男士必看【找女友单身程序员】
    Base 64 Encoding 编码
    如何成为一名优秀的C程序员
    iOS学习笔记—ObjectiveC 委托、非正式协议、正式协议
    程序员学习能力提升三要素
    工程师如何不被PM欺负
    最常被程序员们谎称读过的计算机书籍
    一些重要的算法
    asp调用.Net 托管代码
  • 原文地址:https://www.cnblogs.com/xiaorong/p/1421534.html
Copyright © 2011-2022 走看看