ASP.NET RadioButtonList控件


Web 服务器控件

定義と用法

RadioButtonList コントロールは、ラジオボタングループを作成するために使用されます。

RadioButtonList コントロールの各選択項目は、ListItem 要素によって定義されます。

提示:このコントロールはデータバインディングをサポートしています!


属性

属性 描述 .NET
CellPadding セルの境界線とコンテンツの間のピクセル数。 1.0
CellSpacing テーブルのセル間のピクセル数。 1.0
RepeatColumns ラジオボタングループを表示するときに使用する列数。 1.0
RepeatDirection ラジオボタングループを水平方向に繰り返すか、垂直方向に繰り返すかを指定します。 1.0
RepeatLayout ラジオボタングループのレイアウト。 1.0
runat このコントロールがサーバーコントロールであることを指定します。"server" に設定する必要があります。 1.0
TextAlign テキストをラジオボタンのどちら側(左側か右側)に表示するか。 1.0

ListControl 標準プロパティ

AppendDataBoundItems, AutoPostBack, CausesValidation, DataTextField, DataTextFormatString, DataValueField, Items, runat, SelectedIndex, SelectedItem, SelectedValue, TagKey, Text, ValidationGroup, OnSelectedIndexChanged

The ListControl control covers all the base functions for list controls. Controls that inherits from this control include the CheckBoxList, DropDownList, ListBox, and RadioButtonList controls.

完全な説明については、次のサイトを参照してくださいListControl 标准属性。

Web コントロールの標準プロパティ

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

完全な説明については、次のサイトを参照してくださいWeb 控件标准属性。

コントロール標準プロパティ

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

完全な説明については、次のサイトを参照してください控件标准属性。


实例

RadiobuttonList
この例では、.aspx ファイルで RadioButtonList コントロール、Button コントロール、および Label コントロールを宣言します。次に、Click イベントが発生したときに、テキストと選択された項目を Label コントロールに表示するイベントハンドラを作成します。


Web 服务器控件 其他扩展