Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

BulletedList.BulletImageUrl Property

Note: This property is new in the .NET Framework version 2.0.

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)

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="CS" %>

<html>
<head>   

</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 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.