如何把选中的项目显示在文本框中,不用按钮,选中就直接显示在文本框中.
请大家帮帮忙!

解决方案 »

  1.   

    autopostback=true;
    onselectindexchange事件中加:
    textbox.text=dropdownlist.stlectvalue.tostring();
      

  2.   

    DropDownList1的AutoPostBack设为True
    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
       this.TextBox1.Text = this.DropDownList1.SelectedValue;
    }
      

  3.   

    就提交你的文本框.Text就完了呗
      

  4.   

    DropDownList1的AutoPostBack设为True
    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
       this.TextBox1.Text = this.DropDownList1.SelectedValue;
    }
    我这样做了,可是我调试的时候他根本就不运行到this.TextBox1.Text = this.DropDownList1.SelectedValue.
    是不是和数据库里的数据有关啊,我是把数据库里符合条件的记录放在下拉列表里!