BulletedList.BulletImageUrl Propriedade
Definição
Obtém ou define o caminho para uma imagem a ser exibido para cada marcador em um controle BulletedList.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
Valor da propriedade
O caminho para uma imagem a ser exibido como um marcador individual em um BulletedList.The path to an image to display as each bullet in a BulletedList.
Exemplos
O exemplo de código a seguir demonstra como criar um BulletedList controle e definir a BulletImageUrl propriedade para especificar o caminho para uma imagem personalizada a ser usada para cada marcador.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>
Comentários
Use a BulletImageUrl propriedade para especificar o caminho para uma imagem a ser exibida como cada marcador em um BulletedList controle.Use the BulletImageUrl property to specify the path to an image to display as each bullet in a BulletedList control. Para especificar uma imagem personalizada para os marcadores, você também deve definir a BulletStyle propriedade como o valor CustomImage .To specify a custom image for the bullets, you must also set the BulletStyle property to the value CustomImage.
Observação
O BulletedList controle não oferece suporte à AlternateText propriedade porque os marcadores são inerentemente decorativos e não fornecem informações adicionais que precisam ser transmitidas por meio da tecnologia assistencial.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. No entanto, se você quiser usar uma imagem personalizada para transmitir um conceito ao usuário, deverá adicionar texto adicional a cada um dos itens de lista com marcadores ou usar um controle que permita especificar texto alternativo para cada imagem.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.
Você pode especificar um caminho relativo ou absoluto para a imagem.You can specify either a relative or an absolute path to the image. Um caminho relativo relaciona o local da imagem ao local da página da Web sem especificar um caminho completo no servidor.A relative path relates the location of the image to the location of the Web page without specifying a complete path on the server. O caminho é relativo ao local da página da Web.The path is relative to the location of the Web page. Isso torna mais fácil mover todo o site para outro diretório no servidor sem Atualizar o código.This makes it easier to move the entire site to another directory on the server without updating the code.
O exemplo de código a seguir mostra um caminho relativo para um arquivo de imagem:The following code example shows a relative path to an image file:
\\Images\\image1.jpg
"Images\image1.jpg"
O exemplo de código a seguir mostra um caminho absoluto para um arquivo de imagem:The following code example shows an absolute path to an image file:
"c:\\MyImagesDir\\image1.jpg"
"c"\MyImagesDir\image1.jpg"
O valor dessa propriedade é armazenado em estado de exibição.The value of this property is stored in view state.