<asp:ListItem Text="Tacos" Value="tacos" />
<asp:ListItem Text="Pasta" Value="pasta" />
</asp:CheckBoxList>
BulletedList
The BulletedList control displays bulleted or numbered lists, using <ul> (un-
ordered list) or <ol> (ordered list) tags. Unlike the other list controls, the
BulletedList doesn’t allow the selection of items, so the SelectedIndexChanged
event isn’t supported.
The first property you'll want to set is DisplayMode, which can be Text (the de-
fault), or HyperLink, which will render the list items as links. When DisplayMode
is set to HyperLink, you can use the Click event to react when the user clicks
on one of the items.
The other important property is BulletStyle, which determines the style of the
bullets. The accepted values are Numbered (1, 2, 3, …), LowerAlpha (a, b, c, …),
UpperAlpha (A, B, C, …), LowerRoman (i, ii, iii, …), UpperRoman (I, II, III, …),
Circle, Disc, Square, and CustomImage. If the style is set to CustomImage, you’ll
also need to set the BulletStyleImageUrl to specify the image to be used for
the bullets. If the style is one of the numbered lists, you can also set the
FirstBulletNumber property to specify the first number or letter that’s to be
generated.
Advanced Controls
These controls are advanced in terms of their usage, the HTML code they gener-
ate, and the background work they do for you. Some of these controls aren’t
available to older versions of ASP.NET; we’ll learn more about many of them (as
well as others that aren’t covered in this chapter) as we progress through this
book.
Calendar
The Calendar is a great example of the reusable nature of ASP.NET controls.
The Calendar control generate the markup to display an intuitive calendar in
which the user can click to select or move between days, weeks, months, and so
on.
The Calendar control requires very little customization, and can be created
within a page like this:
112
Chapter 4: Constructing ASP.NET Web Pages