共用方式為


BulletedList Web 伺服器控制項宣告式語法

更新:2007 年 11 月

建立產生項目符號格式之項目清單的控制項。

<asp:BulletedList
    AccessKey="string"
    AppendDataBoundItems="True|False"
    AutoPostBack="True|False"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
        Inset|Outset"
    BorderWidth="size"
    BulletImageUrl="uri"
    BulletStyle="NotSet|Numbered|LowerAlpha|UpperAlpha|LowerRoman|
        UpperRoman|Disc|Circle|Square|CustomImage"
    CausesValidation="True|False"
    CssClass="string"
    DataMember="string"
    DataSource="string"
    DataSourceID="string"
    DataTextField="string"
    DataTextFormatString="string"
    DataValueField="string"
    DisplayMode="Text|HyperLink|LinkButton"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FirstBulletNumber="integer"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|
        Medium|Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    Height="size"
    ID="string"
    OnClick="Click event handler"
    OnDataBinding="DataBinding event handler"
    OnDataBound="DataBound event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnSelectedIndexChanged="SelectedIndexChanged event handler"
    OnTextChanged="TextChanged event handler"
    OnUnload="Unload event handler"
    runat="server"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    Target="string|_blank|_parent|_search|_self|_top"
    ToolTip="string"
    ValidationGroup="string"
    Visible="True|False"
    Width="size"
>
            <asp:ListItem
                Enabled="True|False"
                Selected="True|False"
                Text="string"
                Value="string"
            />
</asp:BulletedList>

備註

使用 BulletedList 控制項建立用項目符號格式化的項目清單。若要指定您希望出現在 BulletedList 控制項中的個別清單項目 (Item),請針對每個項目 (Entry) 在 BulletedList 控制項的開頭和結尾標記之間放置 ListItem 物件。

如需使用 BulletedList 控制項的詳細資訊,請參閱 BulletedList Web 伺服器控制項概觀

範例

下列程式碼範例示範如何建立所含之清單項目格式化為連結按鈕的 BulletedList 控制項。

<asp:BulletedList id="ItemsBulletedList" BulletStyle="Disc"
                  DisplayMode="LinkButton" runat="server">
  <asp:ListItem Value="http://www.cohowinery.com">Coho Winery</asp:ListItem>
  <asp:ListItem Value="https://www.contoso.com">Contoso, Ltd.</asp:ListItem>
  <asp:ListItem Value="http://www.tailspintoys.com">Tailspin Toys</asp:ListItem>
</asp:BulletedList> 
<asp:BulletedList id="ItemsBulletedList" BulletStyle="Disc"
                  DisplayMode="LinkButton" runat="server">
  <asp:ListItem Value="http://www.cohowinery.com">Coho Winery</asp:ListItem>
  <asp:ListItem Value="https://www.contoso.com">Contoso, Ltd.</asp:ListItem>
  <asp:ListItem Value="http://www.tailspintoys.com">Tailspin Toys</asp:ListItem>
</asp:BulletedList> 

請參閱

概念

BulletedList Web 伺服器控制項概觀

參考

BulletedList