Sunday, March 30, 2014

AdRotator in asp.net

<asp:ScriptManager ID="ScriptManager1"
                     runat="server">
  </asp:ScriptManager>
 
  <asp:Timer ID="Timer1" runat="server"
             Interval="1000">
  </asp:Timer>
 
  <asp:UpdatePanel ID="UpdatePanel1"
                   runat="server">
  <Triggers>
  <asp:AsyncPostBackTrigger ControlID="Timer1"
                            EventName="Tick" />
  </Triggers>
 
  <ContentTemplate>
  <asp:AdRotator ID="AdRotator1" runat="server"    AdvertisementFile="~/XMLFile.xml">
  </asp:AdRotator>
  </ContentTemplate>
  </asp:UpdatePanel>


XML File


<Advertisements>
  <Ad>
    <ImageUrl>http://localhost:2564/Ecommerce35Web/img/11.jpg</ImageUrl>
    <NavigateUrl>http://www.asp.net</NavigateUrl>
    <AlternateText>ASP.NET Logo</AlternateText>
    <Keyword>A</Keyword>
    <Impressions>Technology</Impressions>
    <Caption>This is the caption for Ad#1</Caption>
  </Ad>

  <Ad>
    <ImageUrl>http://localhost:2564/Ecommerce35Web/img/12.jpg</ImageUrl>
    <NavigateUrl>http://www.sulekha.net</NavigateUrl>
    <AlternateText>www.Sulekha.net</AlternateText>
    <Keyword>S</Keyword>
    <Impressions>Web Site</Impressions>
    <Caption>This is the caption for Ad#2</Caption>
  </Ad>

  <Ad>
    <ImageUrl>http://localhost:2564/Ecommerce35Web/img/13.jpg</ImageUrl>
    <NavigateUrl>AdRotator.aspx
    </NavigateUrl>
    <AlternateText>www.neostream.net</AlternateText>
    <Keyword>S</Keyword>
    <Impressions>Flash Site</Impressions>
    <Caption>This is the caption for Ad#2</Caption>
  </Ad>
</Advertisements>

No comments:

Post a Comment