有一个 DropDownList 和一个Label 怎么样让 DropDownList的值传到label上,在label上显示年龄。本人菜鸟,求个位大虾帮帮忙!!!

解决方案 »

  1.   

    Label1.Text = DropDownList1.Selected.Value.ToString();
      

  2.   

    DropDownList1.SelectedIndexChange事件
    DropDownList1.SeletedValue
      

  3.   


    注   把这个帮下dropdownlist的 DropDownList1.SelectedIndexChange 中 
      

  4.   

    1.启用DropDownList1的AutoPostBack 即设置AutoPostBack="True"2.双击DropDownList1,自动进入cs页面 并建立DropDownList1_SelectedIndexChanged方法3.把 Label1.Text = DropDownList1.SelectedValue; copy进去 跑起来看效果吧
      

  5.   

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TextBox1.Text = DropDownList1.SelectedValue ;
        }    记得DropDownList1设置属性AutoPostBack="True" 即选择发生变化时要提交页面