Export (0) Print
Expand All

BulletedList.BulletImageUrl Property

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

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public virtual string BulletImageUrl { get; set; }
/** @property */
public String get_BulletImageUrl ()

/** @property */
public void set_BulletImageUrl (String value)

public function get BulletImageUrl () : String

public function set BulletImageUrl (value : String)

Not applicable.

Property Value

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

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.

NoteNote:

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:

[C#]

\\Images\\image1.jpg

[Visual Basic]

"Images\image1.jpg"

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

[C#]

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

[Visual Basic]

"c"\MyImagesDir\image1.jpg"

The value of this property is stored in view state.

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>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft