Suppose mine project is on desktop
C:\Documents and Settings\Mansi\Desktop\ASPStarting
& Mine XML file is in D:\Documents and Settings\Sonia\Desktop\ASPStarting\App_Data

I change the ADRORATOR source code as below-
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile ="C:\Documents and Settings\Mansi\Desktop\ASPStarting\App_Data\banner.xml />

When I execute the website,foll .error comes
ERROR - 'C:\Documents and Settings\Mansi\Desktop\ASPStarting\App_Data\banner.xml' is a physical path, but a virtual path was expected.


<AlternateText>Site1 Main</AlternateText>

<AlternateText>Site2 Main Page</AlternateText>


1)I want to ask that is there any more event to write so dat adrorator works correctly.
2) In <ImageUrl>site2img2.jpg</ImageUrl> - We have to give the whole image file or not?????
3) What is impressions tag do?

8 Years
Discussion Span
Last Post by Ramesh S

1. You don't need to enter the physical path to AdvertisementFile property. It should be a relative path.

Change your code as below

<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile ="~/App_Data/banner.xml"/>

2. You need to give the image file as like AdvertisementFile. For example, if the image file is in the root directory of the web site, then image path should be as below


If you keep the images in a folder, for example in 'images' folder, then it should be


3. Impressions is a value that indicates how often an advertisement is displayed in relation to other advertisements in the XML file.

Edited by Ramesh S: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.