Getting Started
  Introduction
  What is ASP.NET?
  Language Support

ASP.NET Web Forms
  Introducing Web Forms
  Working with Server Controls
  Applying Styles to Controls
  Server Control Form Validation
  Web Forms User Controls
  Data Binding Server Controls
  Server-Side Data Access
  Data Access and Customization
  Working with Business Objects
  Authoring Custom Controls
  Web Forms Controls Reference
  Web Forms Syntax Reference

ASP.NET Web Services
  Introducing Web Services
  Writing a Simple Web Service
  Web Service Type Marshalling
  Using Data in Web Services
  Using Objects and Intrinsics
  The WebService Behavior
  HTML Pattern Matching

ASP.NET Web Applications
  Application Overview
  Using the Global.asax File
  Managing Application State
  HttpHandlers and Factories

Cache Services
  Caching Overview
  Page Output Caching
  Page Fragment Caching
  Page Data Caching

Configuration
  Configuration Overview
  Configuration File Format
  Retrieving Configuration

Deployment
  Deploying Applications
  Using the Process Model
  Handling Errors

Security
  Security Overview
  Authentication & Authorization
  Windows-based Authentication
  Forms-based Authentication
  Authorizing Users and Roles
  User Account Impersonation
  Security and WebServices

Localization
  Internationalization Overview
  Setting Culture and Encoding
  Localizing ASP.NET Applications
  Working with Resource Files

Tracing
  Tracing Overview
  Trace Logging to Page Output
  Application-level Trace Logging

Debugging
  The SDK Debugger

Performance
  Performance Overview
  Performance Tuning Tips
  Measuring Performance

ASP to ASP.NET Migration
  Migration Overview
  Syntax and Semantics
  Language Compatibility
  COM Interoperability
  Transactions

Sample Applications
  A Personalized Portal
  An E-Commerce Storefront
  A Class Browser Application
  IBuySpy.com

  Get URL for this page

AdRotator


Working with AdRotator

The AdRotator control presents ad images that, when clicked, navigate to a new Web location. Each time the page is loaded into the browser, an ad is randomly selected from a predefined list. The following sample illustrates using the AdRotator control.

 
VB AdRotator1.aspx

[Run Sample] | [View Source]

The rotation schedule for ads is defined in an XML file. The following example demonstrates a rotation schedule in the file ads.xml.

    <Advertisements>
       <Ad>
          <ImageUrl>/quickstart/aspplus/images/banner1.gif</ImageUrl>
          <NavigateUrl>http://www.microsoft.com</NavigateUrl>
          <AlternateText>Microsoft.com</AlternateText>
          <Keyword>Computers</Keyword>
          <Impressions>80</Impressions>
       </Ad>
    </Advertisements>

The rotation file defines the following attributes of each ad. Except for ImageUrl, these attributes are optional.

Attribute Description
ImageUrl An absolute or relative URL to the ad image file.
NavigateUrl The Web location to navigate to when the image is clicked. If NavigateUrl is not set, the image is not clickable.
AlternateText The text to render as the ALT attribute of the image. When the page is viewed with Microsoft Internet Explorer, this acts as a ToolTip for the ad.
Keyword Specifies a category for the ad that the page can filter on.
Impressions A number that indicates the "weight" of the ad in the schedule of rotation relative to the other ads in the file. The larger the number, the more often the ad will be displayed.


Copyright 2001 Microsoft Corporation. All rights reserved.