DropDownList1控制TextBox1 事件如何写 b/s结构 DropDownList1,TextBox1 控件 当DropDownList1 选择值为a时,TextBox1不能编辑 当DropDownList1 选择值为b时,TextBox1i可编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将DropDownList的AutoPostBack设为true,然后在它的SeletedChanged事件中写if(DropDownList1.SelectedValue == "a") TextBox1.Enabled = true;else if(DropDownList1.SelectedValue == "b") TextBox1.Enabled = false; 如果要求不刷新2个办法1JS2AJAX可以刷新就简单了把DropDownList的autoPostback开开然后就和C/S一样拉if(DropDownList1.SelectedItems.Text=="a"){ TextBox1.Enable=false;}else{ TextBox1.Enable=true;} function SetEnable(){ var list=document.getElementByID(“DropDownList1”); if(list.value=="a") { document.getElementByID("TextBox1").readOnly=true; } else { document.getElementByID("TextBox1").readOnly=false; }} 写在DropDownList的SelectedIndexChanged事件里面,DropDownList的属性AutoPostBack="True" protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedValue.ToString() == "a") { TextBox1.Enabled = false; } if (DropDownList1.SelectedValue.ToString() == "b") { TextBox1.Enabled = true; } } 请问string.是什么意思 线程问题 【Help】C#--API应用问题 请问这样是不是很消耗资源??谢谢指教 70分 求助 解决即结贴 如何将DataView中某列的数据绑定到DataGridView中的自定义列? 序列化 未将对象引用设置到对象的实例 Bitmap对象这么创建怎么不行啊? 有关在双击dataGrid单元格的问题! Microsoft Agent中PLAY参数可以从何处得到(动画文本) 窗体根据数据库里的信息初始化 读取打印机的问题?(打印问题 ?)
if(DropDownList1.SelectedValue == "a")
TextBox1.Enabled = true;
else if(DropDownList1.SelectedValue == "b")
TextBox1.Enabled = false;
1JS
2AJAX可以刷新就简单了
把DropDownList的autoPostback开开然后就和C/S一样拉if(DropDownList1.SelectedItems.Text=="a")
{
TextBox1.Enable=false;
}
else
{
TextBox1.Enable=true;
}
{
var list=document.getElementByID(“DropDownList1”);
if(list.value=="a")
{
document.getElementByID("TextBox1").readOnly=true;
}
else
{
document.getElementByID("TextBox1").readOnly=false;
}
}
写在DropDownList的SelectedIndexChanged事件里面,DropDownList的属性AutoPostBack="True"
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownList1.SelectedValue.ToString() == "a")
{
TextBox1.Enabled = false;
}
if (DropDownList1.SelectedValue.ToString() == "b")
{
TextBox1.Enabled = true;
}
}