2

I am using adrotator for displaying ads in the page. I have two images saved in xml file; which I want to be shown on the page. But the adrotator is navigated to the xml file but not to the ads specifically. So when I run the page it took random image. Then I added another adrotator but still they choose to pick random images, not separately. I am wondering is there any way to show both images on the page? Here are my aspx and xml file:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="WebLab1.Home" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Online Shop</title>
</head>
<body>
    <header><a href="Home.aspx">Home</a> <a href="Register.aspx">Register</a> <a href="Store.aspx">Store</a> </header>
    <form id="form1" runat="server">
    <div>
       Name:  <asp:TextBox ID="nametxt" runat="server"></asp:TextBox><br />
        <asp:Button ID="loginbtn" runat="server" Text="Login" OnClick="loginbtn_Click" />
        <asp:Button ID="regbtn" runat="server" Text="Register" OnClick="regbtn_Click" />  
    </div>
    </form>
    <asp:AdRotator ID="AdRotator1" AdvertisementFile="~/AdInfo.xml" runat="server" />
    <asp:AdRotator ID="AdRotator2" AdvertisementFile="~/AdInfo.xml" runat="server" />
</body>
</html>


    <?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
  <Ad>
    <ImageUrl>~/Images/google.jpg</ImageUrl>
    <NavigateUrl>https://www.google.se/intl/sv/about/</NavigateUrl>
    <Height>200px</Height>
    <Width>200px</Width>
  </Ad>
  <Ad>
    <ImageUrl>~/Images/youtube.jpg</ImageUrl>
    <NavigateUrl>https://www.youtube.com/channel/UCTrZhDXEa9mHMbQPgey2wJw</NavigateUrl>
    <Height>200px</Height>
    <Width>200px</Width>
  </Ad>

goodWill
  • 21
  • 1

0 Answers0