Latest web development tutorials

ASP.NET HtmlInputRadioButton Controls

HTML Server Controls HTML server controls

Definition and Usage

HtmlInputRadioButton control for controlling the <input type = "radio"> element. In HTML, the element used to create a radio button.


Attributes

属性 描述
Attributes 返回该元素的所有属性名称和值对。
Checked 布尔值,规定该元素是否被选中。
Disabled 布尔值,指示是否禁用该控件。默认是 false。
id 元素的唯一 id。
Name 单选按钮组的名称。
runat 规定该控件是一个服务器控件。必须被设置为 "server"。
Style 设置或返回被应用到该控件的 CSS 属性。
TagName 返回元素的标签名。
Type 元素的类型。
Value 元素的值。
Visible 布尔值,指示该控件是否可见。


Examples

HTMLInputRadiobutton
In this example, we declare in an .aspx file three HtmlInputRadioButton control, a HtmlInputButton control, a HtmlGeneric control (remember to control nested HtmlForm control). When the submit button is triggered, the submit subroutine. submit subroutine response in three ways: If you select the radio button with id = "r1", the server sends a message to the p element "Your favorite color is red". If you select the radio button with id = "r2", the server sends a message "Your favorite color is green" to the p element. If you select the radio button with id = "r3", the server sends a message to the p element "Your favorite color is blue".


HTML Server Controls HTML server controls