Last Updated: February 25, 2016
·
295
· lucamauri

Icons on SyndicationItem

First we create the SyndicationFeed object and read XML data from a feed at the address FeedUri:

Dim SyndFeed As SyndicationFeed = SyndicationFeed.Load(System.Xml.XmlReader.Create(FeedUri))

Then we create a temporary repository for the SyndicationItem objects and populate it:

Dim TempItems As New List(Of SyndicationItem)TempItems.AddRange(SyndFeed.Items.ToList.GetRange(0, 10))

For Each CurrItem As SyndicationItem In TempItems
  CurrItem.ElementExtensions.Add("favico", "", IconUri)
Next

In the aspx page we can access the image with the code:

<img src='<%#CType(Container.DataItem, SyndicationItem).ElementExtensions.ReadElementExtensions(Of String)("favico", "").Item(0).ToString%>' height="16" />