用Dropdownlist1.Attributes.Add("onclick","window.open('new.aspx','mywin')")试试,不要直接加在控件属性中。

解决方案 »

  1.   

    使用ListItem的Value属性
    see that:<form id="Form1" method="post" runat="server">
    <asp:DropDownList id="DropDownList1" runat="server" Width="105px">
    <asp:ListItem Value="1">Page1</asp:ListItem>
    <asp:ListItem Value="2">Page2</asp:ListItem>
    </asp:DropDownList>
    <INPUT type="button" value="Button" onclick="OpenNewWin()">
    </form>
    <script language=javascript>
    function OpenNewWin()
    {
    var ind=document.all["DropDownList1"].selectedIndex ;
    var id=document.all["DropDownList1"][ind].value
    window.open("test.aspx?id="+id);
    }
    </script>
      

  2.   

    谢谢!可我想打开的是:
    Dropdownlist1.Attributes.Add("onclick","window.open('new.aspx?id=i','mywin')")
    参数id的值是随drodownlist中的值变化的.能有办法么?
      

  3.   

    谢谢!hgknight(江雨.net),我试一试