AdCreatedEventArgs Class
Assembly: System.Web (in system.web.dll)
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.
| Topic | Location |
|---|---|
| How to: Select Ads in an AdRotator Web Server Control Programmatically | Building ASP .NET Web Applications |
| How to: Select Ads in an AdRotator Web Server Control Programmatically | Building ASP .NET Web Applications |
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.
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.
<Advertisements> <Ad> <ImageUrl>image1.jpg</ImageUrl> <NavigateUrl>http://www.microsoft.com</NavigateUrl> <AlternateText>Microsoft Main Site</AlternateText> <Impressions>80</Impressions> <Keyword>Topic1</Keyword> <Caption>This is the caption for Ad#1</Caption> </Ad> <Ad> <ImageUrl>image2.jpg</ImageUrl> <NavigateUrl>http://www.wingtiptoys.com</NavigateUrl> <AlternateText>Wingtip Toys</AlternateText> <Impressions>80</Impressions> <Keyword>Topic2</Keyword> <Caption>This is the caption for Ad#2</Caption> </Ad> </Advertisements>
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.