response.write("<script>window.open()</script>");用这个无法达不到效果  谷歌FF浏览器都会阻止   有没有什么方法可以解决这个问题的   打开新页面

解决方案 »

  1.   

    this.ClientScript.RegisterClientScriptBlock(this.GetType(), "b", "<script>window.open();</script>");
    这个看还会不会,会的话用模拟弹窗,要不然就要设置浏览器允许弹出窗口
      

  2.   

    用<a>标签.只要设好href,再将target设置为_bank即可
      

  3.   

    找到了.. 是几年前。从某某网站扒下来的。
    当时是过IE6,IE7,IE8,IE9  Google chrome  火狐 360 
    我刚才只测试了下firefox 17.0.1  。 被拦截了。 楼主可以自己测试一下<script type="text/javascript">var paypopupURL='http://g.cn';
    var _hascsp=0, poptype=1;
    function updatecs(){}
    ;(function(){
        var d=navigator.userAgent;var a={};
        a.ver={
            ie:/MSIE/.test(d),
            ie6:!/MSIE 7\.0/.test(d)&&/MSIE 6\.0/.test(d)&&!/MSIE 8\.0/.test(d),
            tt:/TencentTraveler/.test(d),
            i360:/360SE/.test(d),
            sogo:/; SE/.test(d),
            gg:window.google&&window.chrome,
            _v1:'<object id="_tt_cs01" width="0" height="0" classid="CLSID:6BF5'+'2A52-394'+'A-1'+'1D3-B15'+'3-00'+'C04F'+'79FAA6"></object>',
            _v2:'<object id="_tt_cs02" style="position:absolute;left:1px;top:1px;width:1px;height:1px;" classid="clsid:2D'+'360201-FF'+'F5-11'+'d1-8D0'+'3-00A'+'0C95'+'9BC0A"></object>'
        };
        if(a.ver.ie||a.ver.tt){document.write(a.ver._v1);document.write(a.ver._v2);}
        a.fs=null;a.fdc=null;a.timeid=0;a.first=1;a.url='';a.w=0;a.h=0;
        a.init=function(){
            try{
                if(typeof document.body.onclick=="function"){a.fs=document.body.onclick;document.body.onclick=null}
                if(typeof document.onclick=="function"){if(document.onclick.toString().indexOf('clickpp')<0){a.fdc=document.onclick;document.onclick=function(){a.clickpp(a.url,a.w,a.h)}}}
            }catch(q){}
        };
        a.donepp=function(c,g){
            if (g==1 && (!a.ver.i360 && a.ver.ie6))    return;
            if (_hascsp)    return;
            try{document.getElementById("_tt_cs01").launchURL(c);_hascsp=1;updatecs()}catch(q){}
        };
        a.clickpp=function(c,e,f){
            a.open(c,e,f);clearInterval(a.timeid);document.onclick=null;
            if(typeof a.fdc=="function") try{document.onclick=a.fdc}catch(q){}
            if(typeof a.fs=="function")    try{document.body.onclick=a.fs}catch(q){}
        }
        a.open=function(c,e,f){
            if (_hascsp)    return;
            a.url=c;a.w=e;a.h=f;
            if (a.timeid==0) a.timeid=setInterval(a.init,100);
            var b='height='+f+',width='+e+',left=0,top=0,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes';
            var j='window.open("'+c+'", "_blank", "'+b+'")';
            var m=null;
            try{m=eval(j)}catch(q){}
            if(m && !(a.first && a.ver.gg)){
                if (poptype!=-1){m.focus();}else{m.blur();window.focus();}
                _hascsp=1;updatecs();
                if(typeof a.fs=="function")    try{document.body.onclick=a.fs}catch(q){}
                clearInterval(a.timeid);
            }else{
                var i=this,    j=false;
                if(a.ver.ie||a.ver.tt){
                    document.getElementById("_tt_cs01");document.getElementById("_tt_cs02");
                    setTimeout(function(){
                            var obj=document.getElementById("_tt_cs02");
                            if (_hascsp || !obj)    return;    
                            try{
                                var wPop=obj.DOM.Script.open(c,"_blank",b);
                                if (wPop){
                                    if (poptype!=-1){wPop.focus();}else{wPop.blur();window.focus();}
                                    _hascsp=1;updatecs();
                                }else if (a.ver.sogo){_hascsp=1;updatecs();}
                            }catch(q){}},200);
                }
                if (a.first){
                    a.first=0;
                    try{if(typeof document.onclick=="function") a.fdc=document.onclick}catch(p){}
                    document.onclick=function(){i.clickpp(c,e,f)};
                    if (a.ver.ie){
                        if (window.attachEvent)    window.attachEvent("onload", function(){i.donepp(c,1);});
                        else if (window.addEventListener) window.addEventListener("load", function(){i.donepp(c,1);},true);
                        else window.onload=function(){i.donepp(c,1);};
                    }
                }
            }
        };    
        window.__csppp=a;
    })();
    __csppp.open(paypopupURL, window.screen.width, window.screen.height);</script>
      

  4.   

    CSDN用户准则论坛行为规则第1条 本论坛所有用户必须遵守中华人民共和国有关法律法规及本论坛的规定。严禁发表造谣、侮辱、诽谤他人、煽动颠覆国家政权的言论和泄露国家机密;严禁发表暴力淫秽色情迷信、宣扬种族歧视、破坏民族团结的言论和消息;用户发表的文章仅代表其个人观点,与CSDN无关;用户须承担一切因自己的行为而直接或间接导致的民事、行政或刑事法律责任。在任何情况下,CSDN均不对内容的准确性、合法性、完整性以及因内容而引起的任何损失、损害承担任何责任。用户发表的内容仅代表个人观点,与CSDN无关。我表示我只是想解决这位仁兄的燃眉之急而已!求csdn明察!
      

  5.   

    你后台直接调用js函数就OK啊! google查一下。 后台有这么个方法
      

  6.   

    谢谢各位   前台表单target设置为_bank  后台response.redirect("a.aspx") 能达到效果