System.Web.UI.WebControls Namespace
Represents the method that will handle the AdCreated event of an AdRotator.
[ VB ]
Public Delegate Sub AdCreatedEventHandler ( _
ByVal src As Object, _
ByVal e As AdCreatedEventArgs _
)
[ C# ]
public delegate void AdCreatedEventHandler (
object src,
AdCreatedEventArgs e
);
[ C++ ]
public __gc __delegate void AdCreatedEventHandler (
Object* src,
AdCreatedEventArgs* e
);
In [ JScript ], you can use the delegates in the .NET Framework, but you cannot define your own.
The declaration of your event handler must have the same parameters as the declaration for the AdCreatedEventHandler delegate.
- src
- The source of the event.
- e
- An AdCreatedEventArgs object that contains the event data.
The AdCreated event is raised whenever the AdRotator renders an advertisement on the page.
When you create an AdCreatedEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.
The following example demonstrates how to specify and code a handler for the AdCreated event, and is basically implemented as follows.
- The handler is passed an AdCreatedEventArgs object that contains the event data, which we use here to obtain the AdProperties object.
- The AdProperties object, which contains all the properties for the currently displayed advertisement, is then bound to a Repeater control.
- The Repeater control is then set up to display the image file, the target URL, and the alternate text associated with the advertisement.
Show me
AdRotator AdCreatedEventArgs