Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

AdCreatedEventArgs Class

Provides data for the AdCreated event of the AdRotator control. This class cannot be inherited.


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

public ref class AdCreatedEventArgs : public EventArgs

The AdCreatedEventArgs type exposes the following members.

Public methodAdCreatedEventArgsInitializes a new instance of the AdCreatedEventArgs class.

Public propertyAdPropertiesGets a System.Collections::IDictionary object that contains all the advertisement properties for the currently displayed advertisement.
Public propertyAlternateTextGets 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.
Public propertyImageUrlGets or sets the URL of an image to display in the AdRotator control.
Public propertyNavigateUrlGets or sets the Web page to display when the AdRotator control is clicked.

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

The AdCreated event is raised when the AdRotator control displays an advertisement on the page.

For a list of initial property values for an instance of AdCreatedEventArgs, see the AdCreatedEventArgs constructor.

For more information about handling events, see Events and Delegates.

The following code example demonstrates how to specify and code a handler for the AdCreated event. It gets the URL associated with the advertisement when the AdRotator control gets created and displays it below the control. This example requires the XML file (Ads.xml) listed in the example below.

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.

  <AlternateText>Microsoft Main Site</AlternateText>
  <Caption>This is the caption for Ad#1</Caption> 
  <AlternateText>Wingtip Toys</AlternateText>
  <Caption>This is the caption for Ad#2</Caption> 
No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft