using string builders and checkboxes

Checkbox control is used when you want the user to select more thatn one
option from the available choices. For example, the education of a
person, A person can have a graduate degree, post graduate degree, and a
doctrate. In this case the user selects all the 3 checkboxes. Where as a
person, may just have a graduate degree, in which case he only selects
the graduate checkbox.
Another example would be when you want the user to select the days of
his availability
In short if you want to provide the user with more than one option to
select from, then choose a checkbox control. We can also you checkbox
list control for the same purpose.

Properties of Checkbox Control:
Checked: This is a boolean property that is used to check if the check
box is checked or not.
Text: This is a string property used to get or set the text associated
with the checkbox.
TextAllign: Right or Left. On which side of the check box the text
should appear.
AutoPostBack: Set this property to true, if yuo want the webform to be
posted immediately when the checked status of the checkbox changed

Methods of Checkbox Control
Focus() : Just like TextBox, CheckBox also supports, Focus() method. If
you want to set the input focus, to a specific checkbox, call this
method for th at check box control

Evets of CheckBox Control
CheckedChanged: THis event is fired when the checked status of the check
button control is changed.

Goal is to store the user slection from the checkbox, we can use string
variable to store it but we will use string builder which is in
System.Text

--------------------------code for check box webform1.aspx.cs
---------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
StringBuilder sbUserChoice = new StringBuilder();
if(GraduateCheckBox.Checked) {
sbUserChoice.Append(GraduateCheckBox.Text); }
if (PostGraduateCheckBox.Checked) {
sbUserChoice.Append(PostGraduateCheckBox.Text); }
if(DoctrateCheckBox.Checked)
{sbUserChoice.Append(DoctrateCheckBox.Text);}
Response.Write("You Selected : " + sbUserChoice.ToString() + ", ");
}
-----------------------------End of code for
webform1.aspx.cs---------------------------------------------------------------