1
//刷新父窗口的父窗口
2
Dim strScript As String = "<Script Language='VBScript'>" & vbCrLf
3
strScript &= "opener.parent.document.location.href=""" & "../Individual/UserJobs.aspx?EntityTableID=" & Request("EntityTableID") & "&ListID=" & BLL.TableType.Entity & "&OrgID=" & Request("OrgID") & "&TableID=" & oRightGroupAccessTableView.TemplateTable.TableID & IIf(Request("RecordID") Is Nothing, "", "&RecordID=" & Request("RecordID")) & """" & vbCrLf
4
strScript &= "</Script>" & vbCrLf
5
Response.Write(strScript)
6
//关闭,父窗口弹出对话框,子窗口直接关闭
7
this.Response.Write("<script language=javascript>window.close();</script>");
8
//关闭,父窗口和子窗口都不弹出对话框,直接关闭
9
this.Response.Write("<script>");
10
this.Response.Write("{top.opener =null;top.close();}");
11
this.Response.Write("</script>");
12![]()
13
//弹出窗口刷新当前页面width=200 height=200菜单。菜单栏,工具条,地址栏,状态栏全没有
14
this.Response.Write("<script language=javascript>window.open('rows.aspx','newwindow','width=200,height=200')</script>");
15![]()
16
//弹出窗口刷新当前页面
17
this.Response.Write("<script language=javascript>window.open('rows.aspx')</script>");
18
this.Response.Write("<script>window.open('WebForm2.aspx','_blank');</script>");
19![]()
20
//弹出提示窗口跳到webform2.aspx页(在一个IE窗口中)
21
this.Response.Write(" <script language=javascript>alert('注册成功');window.window.location.href='WebForm2.aspx';</script> ");
22![]()
23
//关闭当前子窗口,刷新父窗口
24
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");
25
this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");
26![]()
27
//子窗口刷新父窗口
28
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;</script>");
29
this.Response.Write("<script>window.opener.location.href='WebForm1.aspx';</script>");
30![]()
31
//弹出提示窗口.确定后弹出子窗口(WebForm2.aspx)
32
this.Response.Write("<script language='javascript'>alert('发表成功!');window.open('WebForm2.aspx')</script>");
33![]()
34
//弹出提示窗口,确定后,刷新父窗口
35
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");
36![]()
37
//弹出相同的一页
38
<INPUT type="button" value="Button" onclick="javascript:window.open(window.location.href)">
39![]()
40
//
41
Response.Write("parent.mainFrameBottom.location.href='yourwebform.aspx?temp=" +str+"';");
42![]()
43![]()
44
<SCRIPT LANGUAGE="javascript">
45
<!--
46
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
47
-->
48
</SCRIPT>
49
50
参数解释:
51
52
<SCRIPT LANGUAGE="javascript"> js脚本开始;
53
window.open 弹出新窗口的命令;
54
'page.html' 弹出窗口的文件名;
55
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
56
height=100 窗口高度;
57
width=400 窗口宽度;
58
top=0 窗口距离屏幕上方的象素值;
59
left=0 窗口距离屏幕左侧的象素值;
60
toolbar=no 是否显示工具栏,yes为显示;
61
menubar,scrollbars 表示菜单栏和滚动栏。
62
resizable=no 是否允许改变窗口大小,yes为允许;
63
location=no 是否显示地址栏,yes为允许;
64
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
65
</SCRIPT> js脚本结束
66![]()
67
'newwin':隐藏菜单栏地址栏工具条
68
width=50:宽度
69
height=50:高度
70
scrollbars=yes/no:滚动条
71
top=50:窗口距离屏幕上方
72
left=50:窗口距离屏幕左侧
73
例:window.open('detail.aspx?ID="+e.Item.Cells[1].Text+"','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');");
74
this.Response.Write("<Script>window.open('WebForm2.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");
75![]()
76
例:
77
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");
78
this.Response.Write("<script>");
79
this.Response.Write("{top.opener =null;top.close();}");
80
this.Response.Write("</script>");
81![]()
82
例: linkcolumn1.DataNavigateUrlFormatString="javascript:varwin=window.open('edit_usr.aspx?actid={0}','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');window.close()";
83![]()
//刷新父窗口的父窗口2
Dim strScript As String = "<Script Language='VBScript'>" & vbCrLf3
strScript &= "opener.parent.document.location.href=""" & "../Individual/UserJobs.aspx?EntityTableID=" & Request("EntityTableID") & "&ListID=" & BLL.TableType.Entity & "&OrgID=" & Request("OrgID") & "&TableID=" & oRightGroupAccessTableView.TemplateTable.TableID & IIf(Request("RecordID") Is Nothing, "", "&RecordID=" & Request("RecordID")) & """" & vbCrLf4
strScript &= "</Script>" & vbCrLf5
Response.Write(strScript)6
//关闭,父窗口弹出对话框,子窗口直接关闭7
this.Response.Write("<script language=javascript>window.close();</script>"); 8
//关闭,父窗口和子窗口都不弹出对话框,直接关闭9
this.Response.Write("<script>");10
this.Response.Write("{top.opener =null;top.close();}");11
this.Response.Write("</script>");12

13
//弹出窗口刷新当前页面width=200 height=200菜单。菜单栏,工具条,地址栏,状态栏全没有14
this.Response.Write("<script language=javascript>window.open('rows.aspx','newwindow','width=200,height=200')</script>");15

16
//弹出窗口刷新当前页面17
this.Response.Write("<script language=javascript>window.open('rows.aspx')</script>");18
this.Response.Write("<script>window.open('WebForm2.aspx','_blank');</script>");19

20
//弹出提示窗口跳到webform2.aspx页(在一个IE窗口中)21
this.Response.Write(" <script language=javascript>alert('注册成功');window.window.location.href='WebForm2.aspx';</script> ");22

23
//关闭当前子窗口,刷新父窗口24
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");25
this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");26

27
//子窗口刷新父窗口28
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;</script>");29
this.Response.Write("<script>window.opener.location.href='WebForm1.aspx';</script>");30

31
//弹出提示窗口.确定后弹出子窗口(WebForm2.aspx)32
this.Response.Write("<script language='javascript'>alert('发表成功!');window.open('WebForm2.aspx')</script>");33

34
//弹出提示窗口,确定后,刷新父窗口35
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");36

37
//弹出相同的一页38
<INPUT type="button" value="Button" onclick="javascript:window.open(window.location.href)">39

40
//41
Response.Write("parent.mainFrameBottom.location.href='yourwebform.aspx?temp=" +str+"';");42

43

44
<SCRIPT LANGUAGE="javascript"> 45
<!-- 46
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行47
--> 48
</SCRIPT> 49
50
参数解释: 51
52
<SCRIPT LANGUAGE="javascript"> js脚本开始; 53
window.open 弹出新窗口的命令; 54
'page.html' 弹出窗口的文件名; 55
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替; 56
height=100 窗口高度; 57
width=400 窗口宽度; 58
top=0 窗口距离屏幕上方的象素值; 59
left=0 窗口距离屏幕左侧的象素值; 60
toolbar=no 是否显示工具栏,yes为显示; 61
menubar,scrollbars 表示菜单栏和滚动栏。 62
resizable=no 是否允许改变窗口大小,yes为允许; 63
location=no 是否显示地址栏,yes为允许; 64
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许; 65
</SCRIPT> js脚本结束66

67
'newwin':隐藏菜单栏地址栏工具条68
width=50:宽度69
height=50:高度70
scrollbars=yes/no:滚动条71
top=50:窗口距离屏幕上方72
left=50:窗口距离屏幕左侧73
例:window.open('detail.aspx?ID="+e.Item.Cells[1].Text+"','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');"); 74
this.Response.Write("<Script>window.open('WebForm2.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");75

76
例:77
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");78
this.Response.Write("<script>");79
this.Response.Write("{top.opener =null;top.close();}");80
this.Response.Write("</script>");81

82
例: linkcolumn1.DataNavigateUrlFormatString="javascript:varwin=window.open('edit_usr.aspx?actid={0}','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');window.close()";83

Dim strScript As String = "
this.Response.Write(
浙公网安备 33010602011771号