现在的问题是重新定向的窗口 在原来弹出的窗口中显示的。
我想要的效果是关闭弹出得窗口,然后重新定向到Search_List.aspx页面,并使此页面最大化。 protected void btnSearch_Click(object sender, EventArgs e)
    {
        string url;
        url = "Search_List.aspx?cCusName=" + txtcCusName.Text + "&cCusCode1=" + txtcCusCode1.Text + "&cCusCode2="+txtcCusCode2 .Text ;
        Response.Write("<script>window.close();</script>");
        Response.Redirect(url);    }

解决方案 »

  1.   

    <script language="javascript" type="text/javascript">function list_area(url)
    {
      window.open(url,"_blank","top=200,left=200,width=560,height=450,resizable=0,scrollbars=1,status=no,toolbar=no,location=no,menu=no'");
    }function ShowDiv(id)
    {
        document.getElementById('test').style.display='block'
    }
    function closeDiv(id)
    {
        document.getElementById('test').style.display='none'
    }
    function reload(city_id,area_id)
    {
        window.opener.location='BDealwith.aspx?city='+city_id+'&buss='+area_id
    }
    function reloadDIV(city,areaid)
    {
        window.location='BDealwith.aspx?city='+city+'&buss='+areaid
    }
    function CloseWin()
    {
        window.close();
    }
    function CloseWin()
    {
        window.close();
    }
    </script><a href="JavaScript:reloadDIV('<%=CityName %>','<%# Eval("BusinessArea") %>');closeDiv('test');">
      

  2.   

    随手给你写了个例子.把newwin里的input的 onclick事件所触发的东西,加到你的response.write里就可以了.<script>
    function test()
    { var newwin=window.open("about:blank","test","width=300,height=220");
    newwin.document.writeln("<input type='button' value='try' onclick='window.close();window.opener.location=\"test.html\";window.opener.resizeTo(screen.width,screen.height);window.opener.moveTo(0,0)' />");
    }
    </script>
    <input type="button" value="try" onclick="test()"/>Response.Write("<script>window.close();window.opener.location=\"Search_list.aspx\";window.opener.resizeTo(screen.width,screen.height);window.opener.moveTo(0,0);</script>");
      

  3.   

    你的代码完全就是实现一个带参的挑转的功能
    为什么不使用js实现?应该尽量少客户端与服务器间的通信 var url = "Search_List.aspx?cCusName=" + document.getElementById(txtcCusNameID).value + "&cCusCode1=" + document.getElementById(txtcCusCode1ID).value + "&cCusCode2="+document.getElementById(txtcCusCode2ID).value;
    字符串组织完毕,然后你可以使用 window.location=url
    或者 window.open(url) 随你喜欢
           
      

  4.   

    To:人, 无完人;学, 无止境
    ===============================================================
    您的方法,还是无法新定向到Search_List.aspx页面 而是在原来弹出的窗口中显示的
      

  5.   

    window.location没有问题的,不要搞太复杂啦,没必要
      

  6.   

    Response.Write("<script>window.close(); window.location.href="xx.aspx" ;</script>");
    加上红色部分不行吗?