<% '******************************************************* '* ASP 101 Sample Code - http://www.asp101.com/ * '* * '* This code is made available as a service to our * '* visitors and is provided strictly for the * '* purpose of illustration. * '* * '* http://www.asp101.com/samples/license.asp * '* * '* Please direct all inquiries to webmaster@asp101.com * '******************************************************* %>

Display a random ad:

<% Dim objAdRotator Dim strAdHtml ' Create our AdRotator object Set objAdRotator = Server.CreateObject("MSWC.AdRotator") ' Setting these properties is optional... included for illustration objAdRotator.Border = 0 objAdRotator.Clickable = True objAdRotator.TargetFrame = "_self" ' Calling the GetAdvertisement method is what does the real work strAdHtml = objAdRotator.GetAdvertisement("adrotator.txt") ' Dispose of our AdRotator object Set objAdRotator = Nothing ' Display the generated ad Response.Write strAdHtml %>