CheckBox & RadioButton

Design








RadioButton


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
 
    protected void Button1_Click(object sender, EventArgs e)
    {
        if(RadioButton1.Checked)
        {
            TextBox1.Text = "Female";
        }
        else
        {
            TextBox1.Text = "Male";
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if(CheckBox1.Checked)
        {
            TextBox2.Text = "C++";
        }
        else if(CheckBox4.Checked)
        {
            TextBox2.Text = "Java";
        }
        else
        {
            TextBox2.Text = "Python";
        }
    }
   
}
            

Output

RadioButton

Output Example

Design








CheckBox


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
 
    protected void Button2_Click(object sender, EventArgs e)
    {
        if(CheckBox1.Checked)
        {
            TextBox2.Text = "C++";
        }
        else if(CheckBox4.Checked)
        {
            TextBox2.Text = "Java";
        }
        else
        {
            TextBox2.Text = "Python";
        }
    }
   
}
            

Output

CheckBox

Output Example