adrotator problem-VBForums
Results 1 to 6 of 6

Thread: adrotator problem

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    adrotator problem

    Hello, all,

    I'm geting the error
    The AdRotator adRotator1 could not find the AdvertisementFile or the file is invalid.

    I've looked around the net and on this forum and it looks like what I have is correct. But for some reason, I'm still geting this error.

    I'm including a very basic example that doesn't even work. What am I doing wrong? I'm using ASP.NET 2.0

    Thanks,

    Strick


    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
    
    <!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>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:AdRotator ID="AdRotator1" AdvertisementFile="/App_Data/FrontPagePics.xml" runat="server" />
        
        </div>
        </form>
    </body>
    </html>
    Here is my xml file code:
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    
    <Advertisments>
      
      <Ad>
        <ImageURL>images/banner1.jpg</ImageURL>
        <NavigateURL>http://www.microsoft.com</NavigateURL>
        <AlternateText>Microsoft Site</AlternateText>
        <Keyword>Computers</Keyword>
        <Impressions>50</Impressions>
      </Ad>
    
    </Advertisments>

  2. #2
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: adrotator problem

    You've capitalized URL. Remember that XML is case sensitive. Use ImageUrl, NavigateUrl, etc.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: adrotator problem

    Hello,

    Unfortunately that didn't work either. I made it small letters and still it didn't work. Very frustrating since most sites on the net and even this forum show how to do it exactly as I have done it. Anything else you think it could be?

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    
    <Advertisments>
    
      <Ad>
        <ImageUrl>images/banner1.jpg</ImageUrl>
        <NavigateUrl>http://www.microsoft.com</NavigateUrl>
        <AlternateText>Microsoft Site</AlternateText>
        <Keyword>Computers</Keyword>
        <Impressions>50</Impressions>
      </Ad>
    
    </Advertisments>

  4. #4
    Hyperactive Member Rocketdawg's Avatar
    Join Date
    Feb 2003
    Location
    Back in the doghouse
    Posts
    291

    Re: adrotator problem

    I've just been setting up a few ad rotators on a site I'm working on.

    Have you tried
    Code:
    AdvertisementFile="~/App_Data/FrontPagePics.xml"
    I think the "~" points to the root.

    Good luck

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2004
    Posts
    541

    Re: adrotator problem

    This is weird as hell, but I got so frustrated that I just deleted my adrotators and xml files and recreated them identically and now they work....

    Strick

  6. #6
    ASP.NET Moderator mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: adrotator problem

    That's the ASP.NET troubleshooting equivalent of Windows: "Please reinstall the application and it should work."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.