现在的位置: 首页 > 综合 > 正文

Response的一些用法

2013年10月27日 ⁄ 综合 ⁄ 共 2273字 ⁄ 字号 评论关闭
//打开新的窗体
Response.Redirect("WebMain.aspx");   
//出一个新窗体
Response.Write("<script>window.open(/"WebMain.aspx/")</script>")
//弹出一个只有确定按钮的提示框
Response.Write("<script>alert(/"名或密码错误/");</script>");
//关闭窗体不提示信息
Response.Write("<script>window.opener=null;window.close();</script>");
//关闭窗体提示一条信息
Response.Write("<script>window.close();</script>");
//关闭窗体提示两条信息
Response.Write("<script>if(confirm(/"确定退出?/")==true){window.close();}</script>");

Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=257511

如何利用网页弹出各形式的窗口,我想大家大多都是知道些的,但那出式窗口是怎搞出来的,我今天就来学一下:
  1.启一个全屏窗口
<html>
<body onload="window.open('http://www.webjx.com','example01','fullscreen');">;
<b>www.webjx.com</b>
</body>
</html>
  2.启一个被F11化后的窗口
<html>
<body onload="window.open(''http://www.webjx.com','example02','channelmode');">;
<b>www.webjx.com</b>
</body>
</html>
  3.启一个有收藏接工具的窗口
<html>
<body onload="window.open('http://www.webjx.com','example03','width=400,height=300,directories');">
<b>www.webjx.com</b>
</body>
</html>
  4.页对话
<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModalDialog('http://www.webjx.com','example04','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>www.webjx.com</b>
</body>
</html>
<html>
<SCRIPT LANGUAGE="javascript">
<!--
showModelessDialog('http://www.webjx.com','example05','dialogWidth:400px;dialogHeight:300px;
dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes')
//-->
</SCRIPT>
<b>http://www.webjx.com</b>
</body>
</html>
  showModalDialog()或是showModelessDialog()
用网页对话框,至于showModalDialog()showModelessDialog()的区,在于showModalDialog()的窗口(称模式窗口),置在父窗口上,必须关闭才能访问父窗口(尽量少用,以免招人反感)showModelessDialog()称无模式窗口),打后不必关闭也可访问父窗口打的窗口。
dialogHeight: iHeight
对话框窗口的高度。

dialogWidth: iWidth
对话框窗口的度。  
dialogLeft: iXPos
对话框窗口相于桌面左上角的left位置。

dialogTop: iYPos
对话框窗口相于桌面左上角的top位置。

center: {yes | no | 1 | 0 }
指定是否将对话框在桌面上居中,默认值“yes”
help: {yes | no | 1 | 0 }
指定对话框窗口中是否示上下文敏感的帮助图标。默认值“yes”  
resizable: {yes | no | 1 | 0 }
指定是否对话框窗口大小可。默认值“no”

status: {yes | no | 1 | 0 }
指定对话框窗口是否示状态栏于非模式对话框窗口,默认值“yes”于模式对话框窗口,默认值
“no”
<asp:LinkButton
ID="BackLbtn"
PostBackUrl
="javascript:history.back()"
runat
="server">
戻る</asp:LinkButton>
<asp:LinkButton
ID="CloseLbtn"
PostBackUrl
="javascript:window.close()"
runat
="server">
閉じる</asp:LinkButton>

 

抱歉!评论已关闭.