在想做个页面,上面有两个DropDownList控件,一个是国内网站列表,一个是国外站列表.AUTOPOSTBACK属性为TRUE现在我在第一个DropDownList里选择网页后可以打开,但在第二个DropDownList里选择后打开的还是第一个DropDownList里选中的网页,即时我在DropDownList2_SelectedIndexChanged事件里设置了DropDownList1.AUTOPOSTBACK=FALSE和DropDownList1.ENABLE=FALSE但还是没用,请问大家应该怎么做才不受干扰呢

解决方案 »

  1.   

    检查一下pageload里面的ispostback有没有设置,可能是每次都会重新加载
      

  2.   

    在JS中写                                            <select name="select2" onchange="ToSelectUrl(this)">
                                                    <option value="#">-中央部门网站链接-</option>
                                                    <option value="http://www.gov.cn/">中国政府网</option>
                                                    <option value="http://www.mca.gov.cn/">中国民政部</option>
                                                    <option value="http://www.xyh99.net/">中国夕阳红网</option>
                                                </select>
        <script type="text/javascript">
        function ToSelectUrl(obj)
        {
            var url=obj.value;
            window.open(url,null,"top=5,left=5,width=600,resizable=yes,height=400,menubar=yes,toolbar=yes,scrollbars=yes,status=yes,location=yes");
        }
        </script>
      

  3.   

    代码如下:AUTOPOSTBACK属性为TRUE<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">
        Sub page_load()             
        End Sub    Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Select Case DropDownList1.SelectedValue
                Case "百度"
                    Response.Redirect("WWW.BAIDU.COOM   ")
                   
                Case "QQ"
                    Response.Redirect("WWW.QQ.COM")
               
            End Select
            
        End Sub    Private Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Select Case DropDownList2.SelectedValue
                Case "YAHOO"
                    Response.Redirect("WWW.YAHOO.COM")
                Case "ASP.NET"
                    Response.Redirect("http://asp.net/")
            End Select
     
        End Sub
    </script>
      

  4.   

    DropDownList2_SelectedIndexChanged
    有没有注册呢
      

  5.   

    在页面上双击那个控件就会注册了,我用c#的!vb.net也应该类似,你试试看!