Category
Use namespace System.Xml
VB.NET
Dim xmlDoc As New XmlDocument
xmlDoc.Load(Server.MapPath(AdRotator1.AdvertisementFile))
Dim imgArrList As New ArrayList
Dim xmlNode As XmlNode
For Each xmlNode In xmlDoc.SelectNodes('/Advertisements/Ad/ImageUrl')
imgArrList.Add(xmlNode.InnerText)
Next
C#
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath(AdRotator1.AdvertisementFile));
ArrayList imgArrList = new ArrayList();
foreach (XmlNode xmlNode in xmlDoc.SelectNodes('/Advertisements/Ad/ImageUrl'))
{
imgArrList.Add(xmlNode.InnerText);
}
PermalinkIf the KeywordFilter property of the AdRotator control is set to a keyword that does not correspond to any
Here is some code that should work properly.
<asp:AdRotator id='AdRotator1' AdvertisementFile='adrot.xml'
runat='server' Width='468px' KeywordFilter ='book' Height='60px'></asp:AdRotator>
adrot.xml
<Advertisements>
<Ad>
<ImageUrl>b2346.jpg</ImageUrl>
<NavigateUrl>http://ww.syncfusion.com</NavigateUrl>
<AlternateText>
The site for ASP.Net FAQs
</AlternateText>
<Impressions>5</Impressions>
<Keyword>book</Keyword>
</Ad>
</Advertisements>
Permalink
<asp:AdRotator id='AdRotator1' AdvertisementFile='adrot.xml'
runat='server' Width='468px' Height='60px'></asp:AdRotator>
adrot.xml
<Advertisements>
<Ad>
<ImageUrl>b2346.jpg</ImageUrl>
<NavigateUrl>http://ww.syncfusion.com</NavigateUrl>
<AlternateText>
The site for ASP.Net FAQs
</AlternateText>
<Impressions>5</Impressions>
</Ad>
</Advertisements>
Permalink