惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
V
Visual Studio Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
Vercel News
Vercel News
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
宝玉的分享
宝玉的分享
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - 未来帅哥

frp增加IP限制 ISAPI Rewrite 实现简单url重写、二级域名重写 SQL作业的操作全 双鱼座2010运程(终于要苦尽甘来了) wwf mvc学习 杂记 国庆节 惊喜 非常完美 最近想看连续剧或电影 无限级分类查询 端午节忙完了 - 未来帅哥 - 博客园 MOSS下面WEBPART开发小结 SubText学习 如何扩大内需 我当圣诞老人跳舞啦! 用户中心 - 博客园 谁不是在被滚了一百次之后,才在一百零一次才叩响成功的大门. 二叉树的HTML显示
打开自适应子窗体,关闭子窗体刷新父窗体
未来帅哥 · 2009-03-25 · via 博客园 - 未来帅哥

-

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