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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
J
Java Code Geeks
C
Check Point Blog
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 司徒正美
IT之家
IT之家
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
U
Unit 42
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ

博客园 - 庞滨

导出excel 查询优化 什么是iBATIS(一) 什么是iBATIS(二) 李彦宏在北大2008本科生毕业典礼上的发言 成长 何为sq注入 如何清除Session/设置Session超时, 如何显示当前的访问人数和总访问量. C#中数据库的连接 页面与页面之间如何传递值?如何获得 URL传过来的值. ASP.NET的错误处理机制 CSS样式 GridView的用法 使GidView变色 GridView中的双向排序 C#如何生成一个XML文件,并保存在硬盘的指定目录下 精美的HTML万年历 点击输入日期的TxtBox框后弹出js日期框供选择 C#正则表达式
关闭网页框架父窗口,并跳转到一个新的窗口。
庞滨 · 2008-06-13 · via 博客园 - 庞滨

我们在做注销时,往往要用到。 将正在用的窗口关闭,跳转到登陆窗口.
1. aspx页面的的代码:

<font color="white">
                            
<asp:Button ID="Button1" runat="server" Text="注销" BackColor="Navy" BorderColor="DarkBlue" Font-Size="Smaller" ForeColor="White" OnClick="Button1_Click" Width="77px" />
                        
</font>
                 

也可以用此方法直接关闭父窗口, 不过会弹出提示关闭的对话框。 我用的是上面的方法。

<href="javascript:parent.close()"><font color="white">注销</font></a>

2. aspx 中的代码中加入当窗口关闭时打开登陆窗口的代码.

<script type="text/javascript">
        var obj = new Object();
        obj.name="i5tt";
        function window.onunload()
        {
             window.open("../Default.aspx");
        }
    
</script>
  
</head>

3.  aspx.cs文件中   关闭有框架的父窗口.

protected void Button1_Click(object sender, EventArgs e)
        
{
            
            Response.Write(
"<script language='javascript'>parent.opener=null; parent.close();</script>");
        }