BulletedList BulletStyle
ASP.NET BulletedList server control creates a control that generates a list of items in a bulleted format.
BulletedList is a list web server control. Each ListItem object in bulletedlist control represents as an item.
All items are contains in an Items collection.
ASP.NET developers can specify bullet type to use to display items in a BulletedList control. BulletStyle property allow us to set BulletedList items bullet type. BulttedtedList BulletStyle enumeration can define the following bullet styles for list items. those are NotSet, Numbered, LowerAlpha, UpperAlpha, LowerRoman, UpperRoman, Disc, Circle, Square and CustomImage.
Numbered bullet style display a number. LowerAlpha bullet style display a lowercase letter. UpperRoman bullet style display an uppercase roman numeral. Disc bullet style display a filled circle, Circle bullet style show an empty circle. CustomImage bullet style display a custom image. FirstBulleteNumber property specify the starting number of list items in an ordered BulletedList control.
The following c# example source code demonstrate us how can we set or change BulletedList bullet style programmatically at run time in asp.net. This example describe you more about how to use bullet style in BulletedList control.
ASP.NET developers can specify bullet type to use to display items in a BulletedList control. BulletStyle property allow us to set BulletedList items bullet type. BulttedtedList BulletStyle enumeration can define the following bullet styles for list items. those are NotSet, Numbered, LowerAlpha, UpperAlpha, LowerRoman, UpperRoman, Disc, Circle, Square and CustomImage.
Numbered bullet style display a number. LowerAlpha bullet style display a lowercase letter. UpperRoman bullet style display an uppercase roman numeral. Disc bullet style display a filled circle, Circle bullet style show an empty circle. CustomImage bullet style display a custom image. FirstBulleteNumber property specify the starting number of list items in an ordered BulletedList control.
The following c# example source code demonstrate us how can we set or change BulletedList bullet style programmatically at run time in asp.net. This example describe you more about how to use bullet style in BulletedList control.
BulletedListBulletStyle.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
BulletedList1.BulletStyle = BulletStyle.LowerAlpha;
}
protected void Button2_Click(object sender, System.EventArgs e)
{
BulletedList1.BulletStyle = BulletStyle.Square;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>How to use bullet style in BulletedList</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Green">BulletedList: Change BulletStyle</h2>
<asp:Label
ID="Label1"
runat="server"
Font-Bold="true"
ForeColor="SaddleBrown"
Text="asp.net controls"
>
</asp:Label>
<asp:BulletedList
ID="BulletedList1"
runat="server"
Width="265"
BorderColor="Crimson"
BackColor="SaddleBrown"
ForeColor="FloralWhite"
BorderWidth="2"
>
<asp:ListItem>GridView</asp:ListItem>
<asp:ListItem>FormView</asp:ListItem>
<asp:ListItem>RadioButtonList</asp:ListItem>
<asp:ListItem>LoginName</asp:ListItem>
<asp:ListItem>UpdatePanel</asp:ListItem>
</asp:BulletedList>
<br />
<asp:Button
ID="Button1"
runat="server"
Font-Bold="true"
ForeColor="SaddleBrown"
Text="BulletStyle LowerAlpha"
OnClick="Button1_Click"
/>
<asp:Button
ID="Button2"
runat="server"
Font-Bold="true"
ForeColor="SaddleBrown"
Text="BulletStyle Square"
OnClick="Button2_Click"
/>
</div>
</form>
</body>
</html>


