Skip to main content

Operations with Radio Button Selection

RadioButton Selection Control

public void RadioButton2_OnCheckedChanged(Object sender, EventArgs e)
{
if(RadioButton1.Checked == true)
{ }

Changing View by RadioButton Selection

public void RadioButton2_OnCheckedChanged(Object sender, EventArgs e)
{
if(RadioButton1.Checked == true)
{
CurrentView = "viewA";
}
else if(RadioButton2.Checked == true)
{
CurrentView = "ViewB";
}
}

Textbox Visible by RadioButton Selection

public void RadioButton2_OnCheckedChanged(Object sender, EventArgs e)
{//Textbox is hidden.
Text3.Style.Add("visibility","hidden")

The hidden Textbox is shown.
Text3.Style.Add("visibility","visible");}

CheckBox Triggering with RadiButton Selection

public void RadioButton1_OnCheckedChanged(Object sender, EventArgs e)
{
if(RadioButton1.Checked == true)
CheckBox2.Checked=true;
}
public void RadioButton2_OnCheckedChanged(Object sender, EventArgs e)
{
if(RadioButton2.Checked == true)
CheckBox2.Checked=false;
}