单选按钮已更改 [英] Radiobutton selected changed
本文介绍了单选按钮已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试编写代码,以便选择单选按钮将禁用文本框.文本框的默认状态应为启用.有什么想法我应该如何编码吗?
我是初学者
I am trying to write code so that selecting a radio button will desable a textbox. The default state of the textbox should be enable. Any ideas how I should code this?
i am beginner
推荐答案
一个新的学期开始了.您的一位同学击败了您.转到此处获取答案:
如何实现代码 [
A new semester has started. One of your classmates beat you to it. Go here for the answer:
How to implement the code[^]
在Page_Load上,将RadioButtons AutoPostback属性设置为true.
受保护的void RadioButton1_CheckedChanged(对象发送者,EventArgs e)
{
Response.Write(RadioButton1.Checked);
如果(RadioButton1.Checked)
{
RadioButton1.Checked = true;
TextBox2.Enabled = true;
}
}
On Page_Load set the RadioButtons AutoPostback Property to true.
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
Response.Write(RadioButton1.Checked);
if (RadioButton1.Checked)
{
RadioButton1.Checked = true;
TextBox2.Enabled = true;
}
}
这篇关于单选按钮已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文