AdRotator.AdCreated Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs each time an advertisement is displayed. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.
public:
event System::Web::UI::WebControls::AdCreatedEventHandler ^ AdCreated;
public event System.Web.UI.WebControls.AdCreatedEventHandler AdCreated;
member this.AdCreated : System.Web.UI.WebControls.AdCreatedEventHandler
Public Custom Event AdCreated As AdCreatedEventHandler
Event Type
Examples
The following code sample handles the AdCreated event, and is only part of a larger example for the AdRotator class overview.
private void AdCreated_Event(Object sender, AdCreatedEventArgs e)
{
Label2.Text = "Clicking the AdRotator control takes you to " +
e.NavigateUrl;
}
Private Sub AdCreated_Event(ByVal sender As Object, _
ByVal e As AdCreatedEventArgs)
Label2.Text = "Clicking the AdRotator control takes you to " + _
e.NavigateUrl
End Sub
Remarks
If the AdvertisementFile property is set, this event occurs after the advertisement has been selected from the file.
The event handler receives an AdCreatedEventArgs property that contains the properties of the advertisement being displayed. The following table shows the properties that provide information specific to this event.
Property | Description |
---|---|
AdProperties | Returns the dictionary that contains all the advertisement properties extracted from an XML file after the AdCreated event is raised. |
AlternateText | Specifies the alternate text and ToolTip (if supported by the browser) to be rendered in the AdRotator control. |
ImageUrl | Specifies the image to be rendered in the AdRotator control. |
NavigateUrl | Specifies the URL reference that the browser navigates to when the advertisement is clicked. |