AdCreatedEventArgs.AlternateText Property

Gets or sets the alternate text displayed in the AdRotator control when the advertisement image is unavailable. Browsers that support the ToolTips feature display this text as a ToolTip for the advertisement.

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

public:
property String^ AlternateText {
	String^ get ();
	void set (String^ value);
}
/** @property */
public String get_AlternateText ()

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

public function get AlternateText () : String

public function set AlternateText (value : String)

Property Value

The text displayed in place of the advertisement image if the image is unavailable. The default value is String.Empty.

Use the AlternateText property to specify the text to display if the image specified in the ImageUrl property is not available. In browsers that support the ToolTips feature, this text also appears as a ToolTip for the advertisement.

A separate XML file contains the properties for the displayed advertisement. The AdRotator control automatically sets the AlternateText property with the corresponding alternate text entry in the XML file. This property can also be used to programmatically set the alternate text.

The following code example demonstrates how to programmatically set the AlternateText property.

No code example is currently available or this language may not be supported.

The following code example demonstrates how to format the XML file that contains the advertisement information. For more information on the XML file, see the AdvertisementFile property of the AdRotator class.

 <Advertisements>
  <Ad>
  <ImageUrl>image1.jpg</ImageUrl>
  <NavigateUrl>http://www.microsoft.com</NavigateUrl>
  <AlternateText>Microsoft Main Site</AlternateText>
  <Impressions>80</Impressions>
  <Keyword>Topic1</Keyword>
  <Caption>This is the caption for Ad#1</Caption> 
  </Ad>
  <Ad>
  <ImageUrl>image2.jpg</ImageUrl>
  <NavigateUrl>http://www.wingtiptoys.com</NavigateUrl>
  <AlternateText>Wingtip Toys</AlternateText>
  <Impressions>80</Impressions>
  <Keyword>Topic2</Keyword>
  <Caption>This is the caption for Ad#2</Caption> 
  </Ad>
 </Advertisements>

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, 1.1, 1.0

Community Additions

ADD
Show: