ערוך

שתף באמצעות


BulletedList.BulletImageUrl Property

Definition

Gets or sets the path to an image to display for each bullet in a BulletedList control.

public:
 virtual property System::String ^ BulletImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string BulletImageUrl { get; set; }
member this.BulletImageUrl : string with get, set
Public Overridable Property BulletImageUrl As String

Property Value

The path to an image to display as each bullet in a BulletedList.

Examples

The following code example demonstrates how to create a BulletedList control and set the BulletImageUrl property to specify the path to a custom image to use for each bullet.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>BulletImageUrl Example</title>
</head>
<body>

    <h3>BulletImageUrl Example</h3>

    <form id="form1" runat="server">
                    
        <asp:BulletedList id="ItemsBulletedList"             
        DisplayMode="Text" 
        BulletStyle="CustomImage"
        BulletImageUrl="Images/image1.jpg"
        runat="server">    
            <asp:ListItem Value="0">Coho Winery</asp:ListItem>
        <asp:ListItem Value="1">Contoso, Ltd.</asp:ListItem>
        <asp:ListItem Value="2">Tailspin Toys</asp:ListItem>
        </asp:BulletedList>                        
              
   </form>

</body>
</html>
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>BulletImageUrl Example</title>
</head>
<body>

    <h3>BulletImageUrl Example</h3>

    <form id="form1" runat="server">
                    
        <asp:BulletedList id="ItemsBulletedList"             
        DisplayMode="Text" 
        BulletStyle="CustomImage"
        BulletImageUrl="Images/image1.jpg"
        runat="server">    
            <asp:ListItem Value="0">Coho Winery</asp:ListItem>
        <asp:ListItem Value="1">Contoso, Ltd.</asp:ListItem>
        <asp:ListItem Value="2">Tailspin Toys</asp:ListItem>
        </asp:BulletedList>                        
              
   </form>

</body>
</html>

Remarks

Use the BulletImageUrl property to specify the path to an image to display as each bullet in a BulletedList control. To specify a custom image for the bullets, you must also set the BulletStyle property to the value CustomImage.

Note

The BulletedList control does not support the AlternateText property because the bullets are inherently decorative and do not provide additional information that needs to be conveyed via assistive technology. However, if you want to use a custom image to convey a concept to the user, you should add additional text to each of the bulleted list items or use a control that allows you to specify alternate text for each image.

You can specify either a relative or an absolute path to the image. A relative path relates the location of the image to the location of the Web page without specifying a complete path on the server. The path is relative to the location of the Web page. This makes it easier to move the entire site to another directory on the server without updating the code.

The following code example shows a relative path to an image file:

\\Images\\image1.jpg
"Images\image1.jpg"

The following code example shows an absolute path to an image file:

"c:\\MyImagesDir\\image1.jpg"
"c"\MyImagesDir\image1.jpg"

The value of this property is stored in view state.

Applies to

See also