Prop Webcontrol Bulletedlist Bulletstyle
## ASP.NET BulletedList BulletStyle Property
The `BulletStyle` property is a member of the `BulletedList` control in ASP.NET. It is used to get or set the style of the bullet points or numbering system applied to the list items.
---
## Definition and Usage
The `BulletStyle` property determines the visual appearance of the list markers (bullets, numbers, letters, or custom images) for each item in a `BulletedList` control. By changing this property, you can easily switch between unordered lists (like circles or squares) and ordered lists (like numbers, letters, or Roman numerals) without changing the underlying data source.
---
## Syntax
```xml
```
### Property Values
The `BulletStyle` property accepts one of the following `BulletStyle` enumeration values:
| Value | Description |
| :--- | :--- |
| `NotSet` | The bullet style is not set. The browser will render the default list style (typically equivalent to `Disc`). |
| `Circle` | Renders as an empty circle (`β`). |
| `Disc` | Renders as a filled circle (`β`). This is the default HTML bullet style. |
| `Square` | Renders as a filled square (`β `). |
| `Numbered` | Renders as sequential numbers (`1, 2, 3...`). |
| `LowerAlpha` | Renders as lowercase alphabetical characters (`a, b, c...`). |
| `UpperAlpha` | Renders as uppercase alphabetical characters (`A, B, C...`). |
| `LowerRoman` | Renders as lowercase Roman numerals (`i, ii, iii...`). |
| `UpperRoman` | Renders as uppercase Roman numerals (`I, II, III...`). |
| `CustomImage` | Renders a custom image as the bullet. The image path must be specified using the `BulletImageUrl` property. |
---
## Code Examples
### Example 1: Basic Numbered List
The following example demonstrates how to set the `BulletStyle` property to `Numbered` to create an ordered list.
```xml
<%@ Page Language="C#" %>
BulletedList BulletStyle Example
```
### Example 2: Using Custom Images
If you want to use a custom icon instead of standard bullets or numbers, set the `BulletStyle` to `CustomImage` and provide the path to your image in the `BulletImageUrl` property.
```xml
```
---
## Considerations and Best Practices
1. **Browser Compatibility**: The rendering of certain styles (such as `Circle`, `Square`, or Roman numerals) relies on the client browser's CSS implementation of list styles.
2. **Custom Image Fallback**: When using `BulletStyle="CustomImage"`, always ensure that the path specified in `BulletImageUrl` is correct. If the image fails to load, the browser may fall back to a default bullet style or display a broken image icon depending on the browser's behavior.
3. **Dynamic Styling**: You can change the `BulletStyle` programmatically in your code-behind file (C# or VB.NET) based on user interaction or page state:
```csharp
bl1.BulletStyle = BulletStyle.UpperRoman;
```
YouTip