a.aspx页面中使用iframe嵌入b.aspx,在b页面中用UpdatePanel包了部分页面,在其中有一Button点击后要弹出网银的充值页面,在ie7下要显示为弹出新选项卡,现在的问题是要求弹出的新选项卡必须自动在最前。我也上网搜了搜,都是在弹出的新页面内加一些代码来实现,可是我在网银提供的页面Send.aspx中加Focus根本没用,请问各位达人该如何实现。
我现在用的代码,点击button后的处理:(可以弹出新选项卡但不在最前)
string newPage = "../Pay/Send.aspx?v_amount=" + txtAddMoney.Text.Trim() + "&re1=" + UserName + "&re2=" + SessionCode;
string strJs = "window.open('" + newPage + "','_blank','height=768,width=1017,top=0,left=0,toolbar=yes,menubar=yes,
scrollbars=yes,resizable=yes,location=yes,status=yes');";
ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "popwindow", strJs, true);Send.aspx中的主要代码为:<form action="https://pay3.chinabank.com.cn/PayGate" method="POST" name="E_FORM"> <input type="hidden" name="v_amount" value="<%=v_amount%>">
<input type="hidden" name="re1" value="<%=re1%>">
<input type="hidden" name="re2" value="<%=re2%>"></form>
我现在用的代码,点击button后的处理:(可以弹出新选项卡但不在最前)
string newPage = "../Pay/Send.aspx?v_amount=" + txtAddMoney.Text.Trim() + "&re1=" + UserName + "&re2=" + SessionCode;
string strJs = "window.open('" + newPage + "','_blank','height=768,width=1017,top=0,left=0,toolbar=yes,menubar=yes,
scrollbars=yes,resizable=yes,location=yes,status=yes');";
ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "popwindow", strJs, true);Send.aspx中的主要代码为:<form action="https://pay3.chinabank.com.cn/PayGate" method="POST" name="E_FORM"> <input type="hidden" name="v_amount" value="<%=v_amount%>">
<input type="hidden" name="re1" value="<%=re1%>">
<input type="hidden" name="re2" value="<%=re2%>"></form>
语法:
oPopup = window . createPopup ( vArgs )
参数:
vArgs : 可选项。为将来的使用保留的变量。返回值:
oPopups : 对象(Object)。返回弹出窗口( popup )对象。说明:
建立一个弹出窗口( popup )。
弹出窗口( popup )初始化为隐藏模式。
当一个激活的对象导致弹出窗口( popup )显示时,此对象不会失去焦点。所以,对象建立一个弹出窗口( popup )时不会激发自己的 onblur 事件。<script>
var oPopup = window.createPopup();
function rdl_doClick(){
var oMessage=document.all("oMessage");
with (oPopup.document.body) {
style.backgroundColor="lightyellow";
style.border="solid black 1px";
innerHTML=oMessage.value;
}
oPopup.show(70, 70, 180, 60, document.body);
}
</script>
<input id=oMessage type=text size=40 value="点击弹出窗口外面的区域关闭它。">
<br><br>
<input type=button value=" 显示弹出窗口 " onclick="rdl_doClick();"> <input type=button value=" 关闭弹出窗口 " onclick="oPopup.hide();">
本文来源于悠悠博客 http://www.ajaxstu.com/ , 原文地址:http://www.ajaxstu.com/archives/1456_3C.html
如果你要兼容的话就只能自己做
里面应该可以帮助解决的!!
就是加个DIV
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>提示信息框</title>
<style type="text/css">
a{ color:#000; font-size:12px;text-decoration:none}
a:hover{ color:#900; text-decoration:underline}
body{background:;filter:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#003366); overflow:hidden}
#massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}
#mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}
.massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
.header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
</style>
<!--实现层移动-->
<script language="javascript">
var Obj=''
document.onmouseup=MUp
document.onmousemove=MMovefunction MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}function MMove(){
if(Obj!=''){
document.all(Obj).style.left=event.x-pX;
document.all(Obj).style.top=event.y-pY;
}
}function MUp(){
if(Obj!=''){
document.all(Obj).releaseCapture();
Obj='';
}
}
</script>
</head><body>
<div id="massage_box"><div class="massage">
<div class="header" onmousedown=MDown(massage_box)><div style="display:inline; width:150px; position:absolute">本站提示信息</div>
<span onClick="massage_box.style.visibility='hidden'; mask.style.visibility='hidden'" style="float:right; display:inline; cursor:hand">×</span></div>
<ul style="margin-right:25"><li>
本人申明此博客所有文章(包括文章插图)均为原创,如需引用或转载请注明出处。
</li><li>欢迎大家对博文中观点留言评述,谢绝无聊人士无素质无观点的灌水漫骂。</li><li>本站已设背景音乐,听音乐盒中收集的音乐时请先到页面底部关闭背景音乐。</li></ul></div></div>
<div id="mask"></div>
<span onClick="mask.style.visibility='visible';massage_box.style.visibility='visible'" style="cursor:hand"><a href="#">显示提示信息</a></span>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>bottom here
</body>
</html>