Tutorial search

Tutorials
Stuff
Affiliates

Cool Stuff




The fastest way to master the basics of Adobe Photoshop

Click here to find out how

Photoshop Templates


Featured Photoshop templates - professional ready to use designs for your next project.

View all templates

ASP.NET Checkbox - ASP.NET tutorial


Learn how to use the checkboxes in ASP.NET and get the status of a checkbox
Category: ASP.NET tutorials - Difficulty:




In this example, we will take a checkbox, a label and a command button and check if the checkbox is checked or not. If it is selected then after the click on the button we will get the message “Checkbox is checked” otherwise “Checkbox is Unchecked”. So lets start…

Step 1

First of all, Open Microsoft Visual Studio and create a new website File-> New-> web Site

Step 2

Here you can give your website a name. By default it is website1, website2 etc.

Step 3

Now let's go to the Design Window.

Step 4

First write the text “Check Box Example” into the page. Then add a checkbox, Button and a Label from Toolbox.

Step 5

This is how it should look like

Step 6

It's time for coding, doubleclick on the button to get to the code window

Step 7

Step 8

Now run your project by clicking start button.

Step 9

First check the checkbox and click on the button … See the output in the window below.

Step 10

Now if you uncheck the checkbox and click on the button then the text of the label will change. See below…

So this was an small example with a simple If then else coding and uses of the ASP.NET checkbox.