当前位置: 首页 > 图文教程 > 专题中心 > ASP.NET入门教程与ASP.NET教程专题 > ASP.NET教程:WEB服务器控件 > Web服务器控件:BulletedList控件

ASP.NET教程:WEB服务器控件
Web服务器控件:XML控件
Web服务器控件:TextBox控件
Web服务器控件:TableRow控件
Web服务器控件:TableCell控件
Web服务器控件:Table控件
Web服务器控件:Style控件
Web服务器控件:BulletedList控件
Web服务器控件:RadioButtonList控件
Web服务器控件:RadioButton控件
Web服务器控件:PlaceHolder控件
Web服务器控件:Panel控件
Web服务器控件:Literal控件
Web服务器控件:ListItem控件
Web服务器控件:ListBox控件
Web服务器控件:LinkButton控件
Web服务器控件:Label控件
Web服务器控件:ImageButton控件
Web服务器控件:Image控件
Web服务器控件:HyperLink控件
Web服务器控件:DropDownList控件

ASP.NET教程:WEB服务器控件 中的 Web服务器控件:BulletedList控件


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-12-06   浏览: 50 ::
收藏到网摘: n/a

阅读此文请先查看软晨学习网的:ASP.NET入门教程:Web服务器控件,简单讲述了Web服务器控件的使用方法。

定义和用法

BulletedList 能够以项目符号的格式来创建列表。创建一个控件,该控件以项目符号格式生成项列表

BulletedList 控件中的每个项目都由 ListItem 元素来定义!

注释:它是 ASP.NET 2.0 中的新类。

属性

属性 描述 .NET
BulletImageUrl

规定定制的列表项目图形符号的 URL。

在 "BulletStyle" 为 "CustomImage" 时使用。

2.0
BulletStyle 规定项目符号列表的样式。 2.0
DisplayMode 规定被显示的列表的类型。 2.0
FirstBulletNumber 规定在有序列表中列表项目的起始数字。 2.0
runat 必需。规定此控件是服务器控件。必须设置为 "server"。 1.0
Target 规定在何处打开目标 URL。 2.0

ListControl 标准属性

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

ListControl 控件包括列表控件的所有基本功能。继承自此控件的控件包括:CheckBoxList, DropDownList, ListBox 以及 RadioButtonList 控件。

Web 控件标准属性

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

控件标准属性

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

语法

<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 控件中显示的各列表项,请针对每项在 BulletedList 控件的开始标记和结束标记之间放置一个 ListItem 对象。

示例

下面的代码示例演示如何创建一个 BulletedList 控件,该控件具有设置为链接按钮格式的列表项。

Visual Basic

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

C#

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