Monday, 13 July 2015

Adrotator

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="Adrotator._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Timer ID="Timer1" Interval="2000" runat="server" />
        <asp:UpdatePanel ID="up1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
        </Triggers>
        <ContentTemplate>
            <asp:AdRotator ID="AdRotator1" runat="server"
            AdvertisementFile="~/XMLFile1.xml" />
               </ContentTemplate>
    </asp:UpdatePanel>
    </div>
       
         
    </form>
</body>
</html>




XMLFile1.xml


<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
  <Ad>
    <!-- The URL for the ad image -->
    <ImageUrl>Birds_small.JPG</ImageUrl>
    <!-- The URL the ad redirects the user to -->
    <NavigateUrl>http://www.microsoft.com</NavigateUrl>
    <!-- The alternate text for the image -->
    <AlternateText>Visit Microsoft's Site</AlternateText>
 </Ad>
  <Ad>
    <ImageUrl>Butterfly_small.jpg</ImageUrl>
    <NavigateUrl>http://www.microsoft.com/technet</NavigateUrl>
    <AlternateText>Support for IT Professionals</AlternateText>
  </Ad>
  <Ad>
    <ImageUrl>calender.jpg</ImageUrl>
    <NavigateUrl>http://msdn.microsoft.com</NavigateUrl>
    <AlternateText>Support for developers</AlternateText>
  </Ad>

</Advertisements>


No comments:

Post a Comment