Wednesday, August 27, 2008

The CheckBox Control[Common Web Server Controls]

The CheckBox Control

1.The CheckBox control gives the user the ability to select between true and false. The CheckBox control’s Text property specifies its caption. Use the TextAlign property to specify on which side that the caption appears. The Checked property is used to set and get the status of the CheckBox control.

Security Alert Populating the CheckBox control’s Text property with data from an untrusted source can create Cross Site Scripting (XSS) vulnerabilities. Use the HttpUtility.HtmlEncode or Server.HtmlEncode method to encode the untrusted data that is placed in the Text property.

2.The CheckedChanged event is raised when the state of the CheckBox control changes, but by default, the AutoPostBack property of the CheckBox control is set to false. This means that changing the checked state does not cause a PostBack, but the Check-Changed event is raised when another control performs a PostBack.

No comments: