asp.net.ph

AdRotator.AdCreated Event

System.Web.UI.WebControls Namespace   AdRotator Class


Occurs once per round trip to the server after the creation of the control, but before the page is rendered.

[ VB ]
Public Event AdCreated As AdCreatedEventHandler

[ C# ]
public event AdCreatedEventHandler AdCreated;

[ C++ ]
public: __event AdCreatedEventHandler* AdCreated;

In [ JScript ], you can handle the events defined by a class, but you cannot define your own.

Event Data

The method assigned to handle the event is passed an AdCreatedEventArgs object containing data related to the AdCreated event. The following AdCreatedEventArgs properties provide information specific to this event.

Property Description
AdProperties Gets the dictionary containing all the advertisement properties extracted from the XML file after the AdCreated event is raised.
AlternateText Specifies the alternate text and tooltip ( if browser supported ) that will be rendered in the AdRotator.
ImageUrl Specifies the image that will be rendered in the AdRotator.
NavigateUrl Specifies the URL reference to navigate to when the advertisement is clicked.

Remarks

This event is raised once per round trip to the server after the creation of the control, but before the page is rendered.

You can control how the AdRotator is displayed by modifying the arguments passed to the event handler of the AdCreated event. If the AdvertisementFile property is not set, this allows you to specify the advertisement information directly, without using a separate advertisement file. If the AdvertisementFile property is set, this allows to extend the behavior of the AdRotator control, such as redirecting to another page.

NOTE: If AdvertisementFile is set, this event occurs after the advertisement has been selected from the file.

For more information about handling events, see Web Forms Events Model.

Example

The following example demonstrates how to specify and code a handler for the AdCreated event. It obtains and displays the target URL, the image file, and the alternate text associated with the advertisement when the AdRotator gets created.

<asp:adrotator runat = "server" target = "_blank"
   advertisementfile = "~/sys/web/ui/webcontrols/demos/Ads.xml"
   onAdCreated = "myAdCreatedHandler" />

 Show me 

See Also

AdRotator Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph