943,740 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 782
  • ASP.NET RSS
Sep 26th, 2009
0

Adrotator

Expand Post »
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

ASP.NET Syntax (Toggle Plain Text)
  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?
Similar Threads
Reputation Points: 17
Solved Threads: 0
Junior Poster in Training
mansi sharma is offline Offline
75 posts
since Apr 2008
Sep 26th, 2009
0

Re: Adrotator

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.NET Syntax (Toggle Plain Text)
  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
ASP.NET Syntax (Toggle Plain Text)
  1. <ImageUrl>YourImageFileName.jpg</ImageUrl>

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

ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 165
Solved Threads: 113
Posting Pro
Ramesh S is offline Offline
580 posts
since Jun 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Show if the User is Online / Off line with specific message
Next Thread in ASP.NET Forum Timeline: ASP to HTML Converter





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC