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.
MINE XML FILE

<Advertisements>

<Ad>
<ImageUrl>site1img1.jpg</ImageUrl>
<NavigateUrl>http://www.site1.com</NavigateUrl>
<AlternateText>Site1 Main</AlternateText>
<Impressions>50</Impressions>
<Keyword>Product1</Keyword>
</Ad>

<Ad>
<ImageUrl>site2img2.jpg</ImageUrl>
<NavigateUrl>http://www.site2.com</NavigateUrl>
<AlternateText>Site2 Main Page</AlternateText>
<Impressions>75</Impressions>
<Keyword>Product2</Keyword>
</Ad>

</Advertisements>

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?

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

<ImageUrl>YourImageFileName.jpg</ImageUrl>

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

<ImageUrl>>~/Images/YourImageFileName.jpg</ImageUrl>

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.