Home > DeveloperSection > Blogs > How to use adrotator in ASP.net

How to use adrotator in ASP.net


ASP.Net ASP.Net 
Ratings:
1 Comment(s)
 2217  View(s)
Rate this:
//create Advertmnt.xml
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
  <Ad>
    <ImageUrl>~/Images/g.jpg</ImageUrl>
    <NavigateUrl>http://www.1800flowers.com</NavigateUrl>
    <AlternateText>
      Order flowers, roses, gifts and more
    </AlternateText>
    <Keyword>flowers</Keyword>
  </Ad>
  <Ad>
    <ImageUrl>~/Images/gg.jpg</ImageUrl>
    <NavigateUrl>http://www.1800flowers.com</NavigateUrl>
    <AlternateText>
      Order flowers, roses, gifts and more
    </AlternateText>
    <Keyword>flowers</Keyword>
  </Ad>
  <Ad>
    <ImageUrl>~/Images/ggg.jpg</ImageUrl>
    <NavigateUrl>http://www.1800flowers.com</NavigateUrl>
    <AlternateText>
      Order flowers, roses, gifts and more
    </AlternateText>
    <Keyword>flowers</Keyword>
  </Ad>
</Advertisements>



//Banner.Aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Banner.aspx.cs" Inherits="Banner" %>

<!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 style="height: 221px">
        
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
    </Triggers>
        <ContentTemplate>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <br />
            <br />
            <asp:AdRotator ID="AdRotator1" runat="server" 
                AdvertisementFile="~/AdvertsmntFile.xml" KeywordFilter="flowers" Target="_blank" />
            
            
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:Timer ID="Timer1" runat="server" Interval="2000">
            </asp:Timer>
    </div>
    </form>
</body>
</html>


great sirji....

By mohit sharma on   2 years ago
this really help me in solving my problems thanks.......

Don't want to miss updates? Please click the below button!

Follow MindStick