ASP.NET SelectedValue属性


ListControl 控件参考手册

定義と用法

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>

演示实例 »

ListControl 控件参考手册 其他扩展