asp.net.ph

AdCreatedEventHandler Delegate

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.

Parameters

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.

Remarks

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.

Example

The following example demonstrates how to specify and code a handler for the AdCreated event, and is basically implemented as follows.

  1. The handler is passed an AdCreatedEventArgs object that contains the event data, which we use here to obtain the AdProperties object.
  2. The AdProperties object, which contains all the properties for the currently displayed advertisement, is then bound to a Repeater control.
  3. 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 

See Also

AdRotator   AdCreatedEventArgs 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