RadioButtonList.RepeatLayout 屬性

定義

取得或設定值,這個值指定要使用 table 項目、ul 項目、ol 項目還是 span 項目來呈現清單。

public:
 virtual property System::Web::UI::WebControls::RepeatLayout RepeatLayout { System::Web::UI::WebControls::RepeatLayout get(); void set(System::Web::UI::WebControls::RepeatLayout value); };
[System.ComponentModel.Bindable(true)]
public virtual System.Web.UI.WebControls.RepeatLayout RepeatLayout { get; set; }
public virtual System.Web.UI.WebControls.RepeatLayout RepeatLayout { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.RepeatLayout : System.Web.UI.WebControls.RepeatLayout with get, set
member this.RepeatLayout : System.Web.UI.WebControls.RepeatLayout with get, set
Public Overridable Property RepeatLayout As RepeatLayout

屬性值

一個值,指定要使用 table 項目、ul 項目、ol 項目還是 span 項目來呈現清單。 預設為 Table

屬性

例外狀況

選項按鈕配置不是其中一個 RepeatLayout 值。

範例

下列程式碼範例示範如何使用 RepeatLayout 屬性來顯示資料表中控制項的專案 RadioButtonList

<%@ Page Language="C#" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.RepeatLayout Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      RepeatColumns = "2" 
      RepeatDirection="Vertical" 
      RepeatLayout="Table"  
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>RadioButtonList.RepeatLayout Example</title>
</head>
<body>

<asp:RadioButtonList id="RadioButtonList1"
      RepeatColumns = "2" 
      RepeatDirection="Vertical" 
      RepeatLayout="Table"  
      runat="server">
 
    <asp:ListItem>Item 1</asp:ListItem>
    <asp:ListItem>Item 2</asp:ListItem>
    <asp:ListItem>Item 3</asp:ListItem>
    <asp:ListItem>Item 4</asp:ListItem>
    <asp:ListItem>Item 5</asp:ListItem>
    <asp:ListItem>Item 6</asp:ListItem>
 
 </asp:RadioButtonList>
</body>
</html>

備註

如需可用選項的相關資訊,請參閱 RepeatLayout 列舉。

注意

在 ASP.NET 4: OrderedListUnorderedList 中,有兩個選項是新的選項。

某些 RepeatLayout 設定不允許水準配置。 如需詳細資訊,請參閱 RepeatLayout 列舉。

適用於

另請參閱