This documentation is archived and is not being maintained.

AdRotator::AlternateTextField Property

Gets or sets a custom data field to use in place of the AlternateText attribute for an advertisement.

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

public:
property String^ AlternateTextField {
	String^ get ();
	void set (String^ value);
}
<asp:AdRotator AlternateTextField="String" />

Property Value

Type: System::String
The name that identifies the field where the alternate text for an advertisement is stored. The default value is "AlternateText."

The AlternateTextField property is used to select a custom data field to use in place of the AlternateText attribute for an advertisement. Like AlternateText, this custom field is defined in the XML file that contains advertisement information.

The following code example demonstrates using the AlternateTextField property to specify a custom data field. The NavigateUrlField, ImageUrlField, and AlternateTextField properties are used to dynamically select a custom field to use in place of the NavigateUrl, ImageUrl, and AlternateText attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices.

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

The following is the sample XML data for the previous example.

<Advertisements>
  <Ad>
    <ImageUrl>~/Images/ad1.gif</ImageUrl>
    <NavigateUrl>http://msdn.microsoft.com/vbasic/</NavigateUrl>
    <AlternateText>Visual Basic Developer Site</AlternateText>
    <Width>140</Width>
    <Height>100</Height>
    <!-- The following custom elements will be used by WAP-enabled
      devices. -->
    <WmlImageUrl>~/Images/mobileAd1.jpg</WmlImageUrl>
    <WmlNavigateUrl>http://msdn.microsoft.com/mobile/</WmlNavigateUrl>
    <WmlAlternateText>Windows Mobile Developer Site</WmlAlternateText>
  </Ad>
  <Ad>
    <ImageUrl>~/Images/ad2.gif</ImageUrl>
    <NavigateUrl>http://msdn.microsoft.com</NavigateUrl>
    <AlternateText>MSDN</AlternateText>
    <Width>150</Width>
    <Height>150</Height>
    <!-- The following custom elements will be used by WAP-enabled
      devices. -->
    <WmlImageUrl>~/Images/mobileAd2.jpg</WmlImageUrl>
    <WmlNavigateUrl>http://msdn.microsoft.com/mobility/</WmlNavigateUrl>
    <WmlAlternateText>Windows Mobile Developer Site</WmlAlternateText>
  </Ad>
</Advertisements>

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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