asp.net.ph

HtmlInputRadioButton.Checked Property

System.Web.UI.HtmlControls Namespace   HtmlInputRadioButton Class


Sets or retrieves a value indicating whether the HtmlInputRadioButton is checked.

Syntax


Inline <input type=radio checked ... >
Script HtmlInputRadioButton.Checked [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true if the HtmlInputRadioButton is currently selected; otherwise, false. Default value is false.

Remarks

Use this property to specify or determine whether the HtmlInputRadioButton control is selected, or checked. This property can also be used to programmatically set the state of the radio button control.

Radio buttons that are not selected do not send their values when the form is submitted.

Example

The following illustrates how the Checked property of an HtmlInputRadioButton control can be used to determine user input.

void chkAnswer ( Object Sender, EventArgs e ) {
   string msg = "";
   if ( Radio1.Checked ) msg += answers [ 0 ];
   else if ( Radio2.Checked ) msg += answers [ 1 ];
   else if ( Radio3.Checked ) msg += answers [ 2 ];
   else if ( Radio4.Checked ) msg += answers [ 3 ];
   Message.InnerHtml = msg;
}

 Show me 

See Also

HtmlInputRadioButton Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph