A Boolean property is one that has a True or a False value. In a form, the value is assigned as a case-insensitive string to an attribute of the same name. In the code, you can refer to the property and compare its value to True or False.

A Read-Only Text Box

A text box is read-only if the visitor can only see or select it but he cannot change its value. To support this characteristic, the TextBox is equipped with a property named ReadOnly.

Checking a Check Box

Probably the most fundamental characteristic of a check box
is its ability to be checked or not. This is controlled by a member named Checked. To
check the control, add an attribute named Checked to the <asp:CheckBox> control
and set its value to "True". Here is an
example:

On the other hand, to find out whether the check box is
checked or not, get the value of that attribute.

Automatically Posting a Check Box

Obviously, to use a check box, the visitor must click it. When this
happens, the control sends a message to the server, in a Click event. To
support this, the CheckBox class is equipped with a member named AutoPostBack,
which accompanies an attribute of the same name. Therefore, to specify that a
check box must automatically send a click notification to the server, set this
attribute as "True".

Checking a Radio Button

To use a radio button, a webpage visitor
must click it. To support this action, the RadioButtonList class has a
Boolean member named AutoPostBack. If you set it to True, when the
control is clicked, it sends a notification to the server. The associated event
is named SelectedIndexChanged. You can use that event ti identify the
radio button that was clicked. Here is an example:

When a user of a webform clicks in a text box, or when the caret lands in a text box, the control is said to have focus. To use another control or do something else on the webpage, the visitor can press Tab or click somewhere else. When this happens, the text box is said to have lost focus, and this action fires an event.

When a text box loses focus, to let you send a notification to the server and possibly take action, the TextBox class is equipped with a Boolean member named AutoPostBack. To take advantage of the lost focus event of a text box, set this member to True.

A Drop Down List/Combo Box

To use a combo box, a webpage visitor can select one of
the items in the list. There are various ways you can find out what item was
selected. You can access the Text value of the SelectedItem member to find out what item was select. Here is an example:

To support the item to be selected, the class is equipped
with a Boolean member named Selected. To specify the item to be selected
as the default, set this member to True.

Finding a Control in a Web Page

To let you find a control in a webpage, the Page class is equipped with a method named FindControl. It takes the identification of the control as a string argument. Once you have the control, you can use it. Here is an example:

In the same way, if a webpage is displaying as a result of an action from another page, you can use the PreviousPage property to get a reference to a (the) control(s) from the previous page, and then use the control as if it were on the current page. Here is an example:

CSS provides tremendous support for styles of webcontrols. Some of the characteristics include the size of a control, the font, the colors, etc. The .NET Framework also provides its own support of those characteristics as properties on the classes for those controls. There are other features that are not available in CSS, or are not handled the same way in CSS.

The Width of a Control

Besides the width style available in CSS, the classes of ASP.NET visual controls are equipped with a property named Width that can be used to control the length of a control. Here are examples: