Adrotator

Reply

Join Date: Apr 2008
Posts: 75
Reputation: mansi sharma is an unknown quantity at this point 
Solved Threads: 0
mansi sharma mansi sharma is offline Offline
Junior Poster in Training

Adrotator

 
0
  #1
Sep 26th, 2009
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

  1. <Advertisements>
  2.  
  3. <Ad>
  4. <ImageUrl>site1img1.jpg</ImageUrl>
  5. <NavigateUrl>http://www.site1.com</NavigateUrl>
  6. <AlternateText>Site1 Main</AlternateText>
  7. <Impressions>50</Impressions>
  8. <Keyword>Product1</Keyword>
  9. </Ad>
  10.  
  11. <Ad>
  12. <ImageUrl>site2img2.jpg</ImageUrl>
  13. <NavigateUrl>http://www.site2.com</NavigateUrl>
  14. <AlternateText>Site2 Main Page</AlternateText>
  15. <Impressions>75</Impressions>
  16. <Keyword>Product2</Keyword>
  17. </Ad>
  18.  
  19. </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?
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 452
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is offline Offline
Posting Pro in Training

Re: Adrotator

 
0
  #2
Sep 26th, 2009
1. You don't need to enter the physical path to AdvertisementFile property. It should be a relative path.

Change your code as below
  1. <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
  1. <ImageUrl>YourImageFileName.jpg</ImageUrl>

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

  1. <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.
Last edited by Ramesh S; Sep 26th, 2009 at 6:09 am.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the ASP.NET Forum


Views: 295 | Replies: 1
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC