弹出的页面是框架页面,包括top和bottom两个框架,在底部框架中,实现关闭页面
this.Page.RegisterStartupScript("ErrorInfo","<script>alert('活动处理成功!');top.opener=null;top.close();</script>");
我怎么能够实现关闭这个页面的时候,父页面重新刷新,或者重新指向父页面。
我在后边加上this.Response.Redirect("Actitydeal.aspx?activityId=" + act_id +" &processId=" +proc_id);这句后,是在弹出页面中,重新定向了这个页面。
this.Page.RegisterStartupScript("ErrorInfo","<script>alert('活动处理成功!');top.opener=null;top.close();</script>");
我怎么能够实现关闭这个页面的时候,父页面重新刷新,或者重新指向父页面。
我在后边加上this.Response.Redirect("Actitydeal.aspx?activityId=" + act_id +" &processId=" +proc_id);这句后,是在弹出页面中,重新定向了这个页面。
解决方案 »
- 两个域名指向相同的程序目录,使用其中一个域名操作时更新的缓存在另一个域名下看还是没更新,不同步
- 老板不允许在IIS里创建应用程序或虚拟目录,偶写的代码RUN不起来,请救呀!
- DataGrid 自定义分页 困惑...
- 帮帮我啊,真是见鬼了!有关获取用户控件内某控件的值的问题!!!
- 如何实现图片轮转的效果
- 散分了......高手来啊===========
- 在App_Data目录下有一个aa.xml文件
- 各位大虾和MVP请进!《《《《《后台aspx页面刷新的时候,如何保证前台被打开的windows form不被置后!!!!!》》》》
- asp.net文件超链接出错!!在线等救!!!
- 终于突破 1K了,可以发200分的问题拉!散分。
- 菜鸟求救,关于aspx的小问题
- 迷惑中,请各位前辈指点!
前面不要top.opener=null;top.close()
直接用window.open(),然后把目标定在top
window.opener.location.reload();
window.close()
this.Page.RegisterStartupScript("ErrorInfo","<script>alert('活动处理成功!');window.open('Actitydeal.aspx?activityId=' + act_id +' &processId=' +proc_id);</script>");
可还是不行啊;
效果是弹出的页面关闭一次,再重新弹出一次,我想关闭整个弹出页面,父页面刷新
在框架页面中包括页面C和页面D,关闭页面B和刷新页面A的代码最好是写在这里边
的事件中。
页面A里放了一个链接,点击打开新页面B。。B是框架页。。框架页的主要HTML代码如下:<frameset cols="201,*" frameborder="NO" border="0" framespacing="0" rows="*" onUnload="opener.location.reload();">
<frame name="leftFrame" scrolling="NO" noresize src="left.htm">
<frame name="mainFrame" src="main.htm">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">
</body>
</noframes> 当我点击A中的链接时,打开页面B。。关闭B时。A刷新了
window.opener.location.reload();
window.close()解决方法2
关闭前运行window.open("原窗口路径","原窗口的框架名(没有的话要起)")
var x = showModelessDialog(......)//打开的页面自动关闭
window.location.reload();
e.Item.Cells[8].Attributes.Add("onclick","window.open('EntityDetails.aspx?actionState="+actionState+"&apply_id="+apply_id+"&unit_id="+unit_id+"&proc_id="+proc_id+"&act_id="+act_id+
"','newwin','height=650,width=700, top=20,left=80,toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no');");
我这里边用到很多参数,不都是从数据集里取出来的
因为打开页面frameset.aspx的是框架.所以你用window.opener刷新父页面会出错..代码已经测试OK..======================***open.aspx页面**============================<HTML>
<HEAD>
<title>open</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<a href="#" onclick="javascript:var winopen=window.open('frameset.aspx','news');">点击打开框架</a>
<form id="Form1" method="post" runat="server">
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 360px; POSITION: absolute; TOP: 200px"
runat="server"></asp:TextBox>
</form>
</body>
</HTML>======================***frameset.aspx页面**============================<frameset cols="201,*" frameborder="NO" border="0" framespacing="0" rows="*" onUnload="opener.location.reload();">
<frame name="leftFrame" scrolling="NO" noresize src="left.htm">
<frame name="mainFrame" src="main.htm">
</frameset>
<noframes>
<body bgcolor="#FFFFFF" runat="server" text="#000000">
</body>
</noframes>======================***main.htm页面**============================
<html>
<head>
<title>main</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<div onclick="javascript:if(parent.opener!=null){parent.opener.location.href='open.aspx';parent.close()}">我是主页面</div>
</body>
</html>
页面A:有个按钮a,点击a打开页面B(用window.open())
页面B:是框架,包含页面C和页面D。D中有个按钮d,点击d关闭框架页面B,同时刷新页面A。。对不对?
private void a_Click(object sender, System.EventArgs e)
{
Page.Response.Write("<script>window.open('B.aspx')</script>");
}页面B:HTML代码:
<frameset cols="201,*" frameborder="NO" border="0" framespacing="0" rows="*" onunload="window.opener.location.href=window.opener.location.href">
<frame name="TopFrame" scrolling="no" noresize src="C.aspx">
<frame name="BottnFrame" src="D.aspx">
</frameset>其中D页面,里有个按钮d,按钮d添加Click事件,代码如下:
private void d_Click(object sender, System.EventArgs e)
{
Page.Response.Write("<script>window.parent.close();</script>");
}我执行过了,点击A页中的按钮弹出B页面,当我点击B框架页中的D页面中的d按钮时,关闭B页面,并且同时刷新了A页面。另外,如果你需要传递参数,可以使用Session