ASP.NET HtmlInputRadioButton 控件
asp.net htmlinputradiobutton 控件

定义和用法
htmlinputradiobutton 控件用于控制 <input type="radio"> 元素。在 html 中,该元素用于创建单选按钮。
属性
属性 | 描述 |
---|---|
attributes | 返回该元素的所有属性名称和值对。 |
checked | 布尔值,规定该元素是否被选中。 |
disabled | 布尔值,指示是否禁用该控件。默认是 false。 |
id | 元素的唯一 id。 |
name | 单选按钮组的名称。 |
runat | 规定该控件是一个服务器控件。必须被设置为 "server"。 |
style | 设置或返回被应用到该控件的 css 属性。 |
tagname | 返回元素的标签名。 |
type | 元素的类型。 |
value | 元素的值。 |
visible | 布尔值,指示该控件是否可见。 |
实例
htmlinputradiobutton
在本例中,我们在 .aspx 文件中声明了三个 htmlinputradiobutton 控件,一个 htmlinputbutton 控件,一个 htmlgeneric 控件(记得把控件嵌套在 htmlform 控件中)。当提交按钮被触发时,会执行 submit 子例程。submit 子例程有三种响应方式:如果选择了带有 id="r1" 的单选按钮,则服务器向 p 元素发送消息 "your favorite color is red"。如果选择了带有 id="r2" 的单选按钮,则服务器向 p 元素发送消息 "your favorite color is green"。如果选择了带有 id="r3" 的单选按钮,则服务器向 p 元素发送消息 "your favorite color is blue"。

相关文章
- ASP 表单
- ASP Cookies
- ASP Server 对象
- ASP Read 方法
- ASP Write 方法
- ASP Drive 属性
- ASP Type 属性
- ASP Keys 方法
- ASP CacheControl 属性
- ASP Pics 属性
- ASP BinaryWrite 方法
- ASP BinaryRead 方法
- ASP StaticObjects 集合
- ASP Contents.RemoveAll 方法
- ASP Abandon 方法
- ASP HTMLEncode 方法
- ASP ASPError 对象的属性
- ASP GetFileName 方法
- ASP GetSpecialFolder 方法
- ASP MoveFile 方法