Right Click On Project Add App_Data FolderRC Add XML File
- <?xml version="1.0" encoding="utf-8" ?>
- <Advertisements>
- <Ad>
- <ImageUrl>~/images/download (1).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.facebook.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>3</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (2).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.jagran.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>2</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (3).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.tatamotors.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>3</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (4).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.tatatechnologies.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>3</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (5).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.flipcart.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>3</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (6).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.amazon.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>5</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- <Ad>
- <ImageUrl>~/images/download (7).jpg</ImageUrl>
- <Width>300</Width>
- <Height>350</Height>
- <NavigateUrl>http://www.apple.com/</NavigateUrl>
- <AlternateText>C-sharpcorner Home Page</AlternateText>
- <Impressions>2</Impressions>
- <Keyword>small</Keyword>
- </Ad>
- </Advertisements>
Add Image folder RC on Project Folder name is images and Insert Images As u want to show Ads.
Add WebForm RC Project and add this code:
- <body>
- <form id="form1" runat="server">
- <div style="margin-left:150px;" aria-haspopup="true">
- <asp:ScriptManager ID="ScriptManager1" runat="server" />
- <asp:Timer ID="Timer1" Interval="1000" runat="server" />
- <asp:UpdatePanel ID="up1" runat="server">
- <Triggers>
- <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
- </Triggers>
- <ContentTemplate>
- <asp:AdRotator ID="AdRotator1" AdvertisementFile="~/App_Data/XMLAds.xml" KeywordFilter="small" runat="server"
- BorderStyle="Dotted"/>
- </ContentTemplate>
- </asp:UpdatePanel>
- </div>
- <div style="margin-left:200px;">
-
- </div>
- </form>
- </body>
Build the solution and run the application