Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common problems with using AdRotator controls in asp.net

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the common problems in using AdRotator controls in asp.net", the content is simple and clear, and I hope it can help you solve your doubts. Let me lead you to study and learn about "what are the common problems in using AdRotator controls in asp.net".

The AdRotator control is a server control that generates random advertising elements on the page and gets or sets the path of the XML file containing advertising information through the AdvertisementFile property. The following is the xml file I wrote during the test:

/ / File name:Ads.xml / / Author:Hoyah

< ?xml version="1.0" encoding="utf-8" ?>

< Adertisements>

< Ad>

< ImageUrl>

Images/5.jpg

< /ImageUrl>

< NavigateUrl>

Http://hi.baidu.com/hoyah

< /NavigateUrl>

< AlternateText>

Hoyah's Space

< /AlternateText>

< Impressions>

two hundred

< /Impressions>

< Keyword>

Hoyah

< /Keyword>

< /Ad>

< Ad>

< ImageUrl>

Images/1.jpg

< /ImageUrl>

< NavigateUrl>

Http://g.cn

< /NavigateUrl>

< AlternateText>

Google

< /AlternateText>

< Impressions>

five hundred

< /Impressions>

< Keyword>

Google

< /Keyword>

< /Ad>

< /Adertisements>

The code for the body section of the page is as follows:

< form ID="form1" runat="server">

< asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="Ads.xml" Target="_blank"/>

< br />

< /form>

The following error message about the AdRotator control appears at run time:

The AdRotator AdRotator1 could not find the AdvertisementFile or the file is invalid.

I checked it several times but found no problem. Later, a closer look found that the Advertisements in Ads.xml is misspelled as Adertisements, and the system will not tell you exactly what went wrong at run time. So when you encounter such a problem, first check to see if there is any misspelling, and then look at the case problem, because xml is strictly case-sensitive. For example, if you put the above in Ads.xml

< NavigateUrl>

Http://hi.baidu.com/hoyah

< /NavigateUrl>

Mistakenly written as

< Navigateurl>

Http://hi.baidu.com/hoyah

< /Navigateurl>

There will be the same mistake as the wrong word on it. In addition, pay attention to the path of the picture and the path of the xml file that AdvertisementFile points to, which are particularly error-prone.

The above is all the content of the article "what are the common questions about using AdRotator controls in asp.net?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report