商品名称 Dropdownlist
商品单价 Textbox
选择不同的Dropdownlist的不同的商品名称,Textbox的商品单价也会随之改变
自己顶一下

解决方案 »

  1.   

    Dropdownlist的selectedChanged事件中获取单价,Dropdownlist的AutoPostBack设为true
      

  2.   

    在selectedChanged里
    获取Dropdownlist1.SelectValue
      

  3.   

    DropDownList的AutoPostback的属性设为true,然后在selectChanged里面用Dropdownlist1.SelectValue 
    前提是要绑定DropDownList时,将其value绑定为商品单价,在变化的时候取对应的value就行~~~
      

  4.   

    在selectChanged方法中填写相关代码就行
      

  5.   

    selectedChanged  事件里  得到值 就行了
      

  6.   

    用changed事件判断combox的值,然后做操作
      

  7.   

    呵呵 lsd的说的都不错哦,LZ去试试吧 应该没问题的
      

  8.   

    this.TextBox1.Text =  this.DropDownList1.SelectedValue;
    dropdownlist加属性 AutoPostBack="true" 或者
    dropdownlist加时间 OnTextChanged="DropDownList1_TextChanged" protected void DropDownList1_TextChanged(object sender, EventArgs e)
        {
            this.TextBox1.Text = this.DropDownList1.SelectedValue;
        }
      

  9.   

    楼上正解,AutoPostback的属性设为true,不设置这个属性,你取不到值
      

  10.   

    写在选择项改变事件里面:
    1.根据选择项得到商品ID
    2.根据ID去查找数据库
    3.返回的价格赋给文本框