下拉列表DropDownList 商品名称 Dropdownlist商品单价 Textbox选择不同的Dropdownlist的不同的商品名称,Textbox的商品单价也会随之改变自己顶一下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Dropdownlist的selectedChanged事件中获取单价,Dropdownlist的AutoPostBack设为true 在selectedChanged里获取Dropdownlist1.SelectValue DropDownList的AutoPostback的属性设为true,然后在selectChanged里面用Dropdownlist1.SelectValue 前提是要绑定DropDownList时,将其value绑定为商品单价,在变化的时候取对应的value就行~~~ 在selectChanged方法中填写相关代码就行 selectedChanged 事件里 得到值 就行了 用changed事件判断combox的值,然后做操作 呵呵 lsd的说的都不错哦,LZ去试试吧 应该没问题的 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; } 楼上正解,AutoPostback的属性设为true,不设置这个属性,你取不到值 写在选择项改变事件里面:1.根据选择项得到商品ID2.根据ID去查找数据库3.返回的价格赋给文本框 winfrom中如何调用另一个项目中的页面 关于c#的string 的问题!求助啊 C# 20003 上下键 如何实现把自已的邮箱附件的文件保存到本地指定的目录?? 求助用c#编写C/S模式的网上考试系统怎么实现自动评分功能?那位高手有源码? StreamReader.Peek方法和StreamReader.Read方法的问题? 读取Debug下的.exe文件的所有依赖项 Winform 抓包问题? 初学者,只需要很简单的vb.net实现的功能案例 最简单最初级的问题 一个屏幕保护程序实现了一个标签从右到左移动 到头之后循环继续从右到左 有个地方不明白 C#中操作xml问题
获取Dropdownlist1.SelectValue
前提是要绑定DropDownList时,将其value绑定为商品单价,在变化的时候取对应的value就行~~~
dropdownlist加属性 AutoPostBack="true" 或者
dropdownlist加时间 OnTextChanged="DropDownList1_TextChanged" protected void DropDownList1_TextChanged(object sender, EventArgs e)
{
this.TextBox1.Text = this.DropDownList1.SelectedValue;
}
1.根据选择项得到商品ID
2.根据ID去查找数据库
3.返回的价格赋给文本框