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>

解决方案 »

  1.   

    createPopup方法2008年03月04日 星期二 16:46
    语法: 
    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();">&nbsp;<input type=button value=" 关闭弹出窗口 " onclick="oPopup.hide();"> 
    本文来源于悠悠博客 http://www.ajaxstu.com/ , 原文地址:http://www.ajaxstu.com/archives/1456_3C.html 
      

  2.   

    实在不行就用模式窗体吧,不过那个不可以传参数,必须有专门的脚步接参数,可以考虑在模式窗体里加一个iframe,将接好的参数传递给iframe里面的页面 这样应该是没有问题的
      

  3.   

    如果是IE的话可以使用模态窗口(window.showModalDialog()),使用方法中的第二个参数可在父页及模态窗口间传递对象及参数。火狐下不支持模态窗口,只能自己用DIV做一个浮起的层进行控制。
    如果你要兼容的话就只能自己做
      

  4.   

    参考一下这个网址:http://bbs.itdigger.com/viewthread.php?tid=918
    里面应该可以帮助解决的!!
      

  5.   

    用模态窗口的话会弹出send.aspx这个空白页面!而且尺寸无法缩小为0
      

  6.   

    你可以在要弹出的新选项卡的网页上做个DIV就和QQ网站的登陆差不多那回事
      

  7.   

    你说是在send.aspx上做?那是个自动跳转页面啊
      

  8.   

    是在你要的弹出的页面上做
    就是加个DIV
      

  9.   

    <html>
    <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>