ASP.NET SelectedValue 属性
ASP.NET SelectedValue 属性

定义和用法
SelectedValue 属性表示列表中选定项的值。
实例
下面的实例获取 RadioButtonList 控件中的某个 ListItem 的值:
<script runat="server">
Sub Change(obj As Object, e As EventArgs)
Response.Write("You selected " & rb1.SelectedValue)
End Sub
</script>
<form runat=server>
<asp:RadioButtonList id="rb1" AutoPostBack="true"
runat="server" OnSelectedIndexChanged="Change">
<asp:ListItem Value="Item 1" />
<asp:ListItem Value="Item 2" />
</asp:RadioButtonList>
</form>
Sub Change(obj As Object, e As EventArgs)
Response.Write("You selected " & rb1.SelectedValue)
End Sub
</script>
<form runat=server>
<asp:RadioButtonList id="rb1" AutoPostBack="true"
runat="server" OnSelectedIndexChanged="Change">
<asp:ListItem Value="Item 1" />
<asp:ListItem Value="Item 2" />
</asp:RadioButtonList>
</form>

相关文章
- ASP Cookies
- ASP Application 对象
- ASP 引用文件
- ASP FileSystem 对象
- ASP Dictionary 对象
- AJAX 简介
- ASP Close 方法
- ASP Skip 方法
- ASP Drive 属性
- ASP Delete 方法
- ASP Move 方法
- ASP Key 属性
- ASP Items 方法
- ASP TotalBytes 属性
- ASP Application_OnStart 和 Application_OnEnd 事件
- ASP ASPError 对象的属性
- ASP FolderExists 方法
- ASP OpenTextFile 方法
- ASP.NET HtmlAnchor 控件
- ASP.NET HtmlSelect 控件