---
title: "Checkbox in ASP.Net"  
description: "The Checkbox control is used to display a check box. The Checkbox Web server control gives us an option to select. A checkbox is clicked to select and"  
author: "Pushpendra Singh"  
published: 2010-10-13  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/164/checkbox-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Checkbox in ASP.Net

The [Checkbox control](https://www.mindstick.com/articles/291/how-should-use-checkbox-control-in-vb-dot-net) is used to display a [check](https://yourviews.mindstick.com/view/81033/coronavirus-does-not-check-religion) box. The Checkbox Web [server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) control gives us an [option](https://www.mindstick.com/forum/158788/what-is-rust-s-option-type-and-how-is-it-used-for-handling-nullable-values) to [select](https://www.mindstick.com/forum/34066/use-select-operator-in-linq). A checkbox is clicked to select and clicked again to deselect option. When a checkbox is selected, a check (a tick mark) appears indicating a selection.\

![Checkbox Control in ASP.Net](https://www.mindstick.com/mindstickarticle/81cbe835-6b73-431e-b5e0-9282fbd56729/images/bca195aa-55a0-42b7-8dd9-5991d91819ab.png)

\
The main event of the Checkbox is the Checked Changed event

## Code:

```
<asp:Label ID="Label2" runat="server" Text="Which programming language you know"></asp:Label><br />         <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged"            Text="C#" />         <br />         <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox2_CheckedChanged"            Text="Java" />         <br />         <asp:CheckBox ID="CheckBox3" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox3_CheckedChanged"            Text="VB" />  When you check the checkbox then  CheckedChanged event will fire if  AutoPostBack="True"  protected void CheckBox1_CheckedChanged(object sender, EventArgs e){ if (CheckBox1.Checked)Label1.Text = CheckBox1.Text;}  protected void CheckBox2_CheckedChanged(object sender, EventArgs e){ if (CheckBox2.Checked) {Label1.Text = CheckBox2.Text; } if (CheckBox2.Checked & CheckBox1.Checked) {Label1.Text = CheckBox1.Text + CheckBox2.Text; }       }  protected void CheckBox3_CheckedChanged(object sender, EventArgs e){ if (CheckBox3.Checked)Label1.Text = CheckBox3.Text;}
```

![Checkbox Control in ASP.Net](https://www.mindstick.com/mindstickarticle/81cbe835-6b73-431e-b5e0-9282fbd56729/images/2330af31-400b-4d33-817c-9e8d850a801a.png)

When you check the checkbox then CheckedChanged [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) will [fire](https://www.mindstick.com/forum/155770/amazon-fire-tv-stick-remote-not-working) and it will show the checked [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) in the [Label](https://www.mindstick.com/articles/12835/print-label-tracking-how-do-these-features-make-auspost-woocommerce-plugin-better).

---

Original Source: https://www.mindstick.com/articles/164/checkbox-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
