Radiobutton control example

Radiobutton control example

Previous Home Next

 

The RadioButton Web server control is similar to CheckBox but RadioButtons are displayed as rounded instead of box. 

   
     

    

 ..................Desigining code for two Radio button.............
....................................................................
     
         
        
....................................................................
....................................................................
.............cs code for button click.............................
....................................................................


protected void Button1_Click(object sender, EventArgs e)
    {
        if (RadioButton1.Checked)
        {

            TextBox1.Text = RadioButton1.Text.ToString();
        }
        else if (RadioButton2.Checked)
        {
            TextBox1.Text = RadioButton2.Text.ToString();
        }
        else
        {
            TextBox1.Text = "select any one";        
        
        }
    }
..................................................................
Previous Home Next