如果选择一个单选按钮,则隐藏单选按钮 [英] hide Radio button if one radio button selected
本文介绍了如果选择一个单选按钮,则隐藏单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的FRNDS,
我有3个单选按钮,分别为Admin,Manager,User
还有另外两个单选按钮,分别是Display,Display和Print.
所以我的要求是当我选择User(Radiobutton)时,另一个DisplayANDprint(Radiobutton必须隐藏)
请帮助,该怎么做.
谢谢.
Dear FRNDS,
I have 3 radio buttons as Admin, Manager,User
and also I have another 2 radio buttons as Display , Display and Print.
So My requirement is when i select User(Radiobutton) the other DisplayANDprint(Radiobutton must hide)
Please help , how to do this.
Thanks.
推荐答案
if radiobtn1.selected==true
{
radiobtn2.visible= false;
}
在后台,您可以访问项目的属性并为其指定CSS样式.
因此,您应该可以通过指定以下内容以编程方式对其进行分配:
Hi,
Under the hood, you can access the attributes of the item and assign it a CSS style.
So you should be able to then programmatically assign it by specifying:
RadioButtonList.Items(1).CssStyle.Add("visibility", "hidden");
并完成工作.
--Amit
and get the job done.
--Amit
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (RadioButtonList1.SelectedValue.ToString() == "1")
{
RadioButtonList2.Visible = true;
}
else if (RadioButtonList1.SelectedValue.ToString() == "2")
{
rdoPowerAvail.Visible = false;
}
}
}
一次检查您的控件...
check with your controls once...
这篇关于如果选择一个单选按钮,则隐藏单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文