一分心灵的宁静

在滚滚红尘,繁杂人世里,能够保持一分心灵的宁静,随时回到自己的内心深处,细细品味生命的奥妙,无疑是一种修身养性的人生境界

导航

弹出窗口总结

Posted on 2006-02-11 13:22  有缘无份  阅读(211)  评论(0编辑  收藏  举报
 1//刷新父窗口的父窗口
 2Dim strScript As String = "<Script Language='VBScript'>" & vbCrLf
 3strScript &= "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
 4strScript &= "
</Script>" & vbCrLf
 5Response.Write(strScript)
 6//关闭,父窗口弹出对话框,子窗口直接关闭
 7this.Response.Write("<script language=javascript>window.close();</script>"); 
 8//关闭,父窗口和子窗口都不弹出对话框,直接关闭
 9this.Response.Write("<script>");
10this.Response.Write("{top.opener =null;top.close();}");
11this.Response.Write("
</script>");
12
13//弹出窗口刷新当前页面width=200 height=200菜单。菜单栏,工具条,地址栏,状态栏全没有
14this.Response.Write("<script language=javascript>window.open('rows.aspx','newwindow','width=200,height=200')</script>");
15
16//弹出窗口刷新当前页面
17this.Response.Write("<script language=javascript>window.open('rows.aspx')</script>");
18this.Response.Write("<script>window.open('WebForm2.aspx','_blank');</script>");
19
20//弹出提示窗口跳到webform2.aspx页(在一个IE窗口中)
21this.Response.Write(" <script language=javascript>alert('注册成功');window.window.location.href='WebForm2.aspx';</script> ");
22
23//关闭当前子窗口,刷新父窗口
24this.Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");
25this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");
26
27//子窗口刷新父窗口
28this.Response.Write("<script>window.opener.location.href=window.opener.location.href;</script>");
29this.Response.Write("<script>window.opener.location.href='WebForm1.aspx';</script>");
30
31//弹出提示窗口.确定后弹出子窗口(WebForm2.aspx)
32this.Response.Write("<script language='javascript'>alert('发表成功!');window.open('WebForm2.aspx')</script>");
33
34//弹出提示窗口,确定后,刷新父窗口
35this.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//
41Response.Write("parent.mainFrameBottom.location.href='yourwebform.aspx?temp=" +str+"';");
42
43
44<SCRIPT LANGUAGE="javascript"> 
45<!-- 
46window.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':隐藏菜单栏地址栏工具条
68width=50:宽度
69height=50:高度
70scrollbars=yes/no:滚动条
71top=50:窗口距离屏幕上方
72left=50:窗口距离屏幕左侧
73例:window.open('detail.aspx?ID="+e.Item.Cells[1].Text+"','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');"); 
74this.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例:
77this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");
78this.Response.Write("<script>");
79this.Response.Write("{top.opener =null;top.close();}");
80this.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