Why will my AdRotator not display images? (Image paths are correct)
Posted
by KSwift87
on Stack Overflow
See other posts from Stack Overflow
or by KSwift87
Published on 2010-04-18T00:28:14Z
Indexed on
2010/04/18
0:33 UTC
Read the original article
Hit count: 522
Hi. I'm writing a simple web application in C# and I've gotten to the part where I must add an AdRotator object and link four images to it. I have done this, but no matter what I do the images will not show up; only the alternate text. It makes no sense because the paths are correct. Supposedly AdRotator controls are really simple to use... But anyway below is my code.
Search.aspx:
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="Module6.WebForm2" Title="Search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<form id="Search" runat="server">
This is the Search page!
<div class="StartCalendar">
<asp:Calendar ID="Calendar1" runat="server" Caption="Start Date" TodayDayStyle-Font-Bold="true"
TodayDayStyle-ForeColor="Crimson" SelectedDayStyle-BackColor="DarkCyan" />
</div>
<div class="EndCalendar">
<asp:Calendar ID="Calendar2" runat="server" Caption="End Date" TodayDayStyle-Font-Bold="true"
TodayDayStyle-ForeColor="Crimson" SelectedDayStyle-BackColor="DarkCyan" />
</div>
<br /><br />
<div class="Search">
<asp:Button ID="btnSearch" runat="server" Text="Search" UseSubmitBehavior="true" />
</div><br /><br />
<div class="CenterAd">
<asp:AdRotator ID="AdRotator1" runat="server" Target="_blank" AdvertisementFile="~/Advertisements.xml" />
</div>
<br /><br />
<div class="Results">
<asp:GridView ID="gvResults" runat="server" />
</div>
</form>
</asp:Content>
Advertisements.xml:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageURL>~/images/colts.jpg</ImageURL>
<AlternateText>Colts Image</AlternateText>
</Ad>
<Ad>
<ImageURL>~/images/conseco.gif</ImageURL>
<AlternateText>Conseco Image</AlternateText>
</Ad>
<Ad>
<ImageURL>~/images/IndianapolisIndians.png</ImageURL>
<AlternateText>Indianapolis Indians Image</AlternateText>
</Ad>
<Ad>
<ImageURL>~/images/pacers.gif</ImageURL>
<AlternateText>Pacers Image</AlternateText>
</Ad>
</Advertisements>
Any and all help is GREATLY appreciated.
© Stack Overflow or respective owner