DropDownList控件 用什么事件调用JS好   
怎么写JS获取DropDownList改变时的值

解决方案 »

  1.   

    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
    Response.Write( DropDownList1.SelectedItem.Text );
                    Response.Write(<script></script>);
    }
    小弟也是初学者
      

  2.   

    呵呵 我不是指的.cs文件里面获取DropDownList  是用JS写
      

  3.   

    使用options[index]取值DropDownList在客户端就是个select标签
      

  4.   

    onchange事件
        protected void Page_Load(object sender, EventArgs e)
        {
            DropDownList1.Attributes.Add("onchange", "change()");
        }js:
        <script type="text/javascript">
        function change()
        {
            var str=document.getElementById("DropDownList1").value;
            alert(str);
        }
        </script>
      

  5.   

    但是 onchange事件好像对下拉框不起作用 不触发事件
      

  6.   

    我换个方位问下 我要达到的效果就是下拉框改变时根据下拉框的值  来隐藏掉相应的表中的行 也就是<tr>