Skip to main content
added 140 characters in body
Source Link
Bart
  • 20k
  • 8
  • 71
  • 79

Taken from http://www.haiders.net/post/C-RSS-Feed-Fetcher-Display-RSS-Feed-with-2-lines-of-Code.aspx

//www.haiders.net | Jan 2010
//C# Example: Fetch and Shape RSS Feed
    string rssUri = "http://some.feed.uri.xml";
    var doc = System.Xml.Linq.XDocument.Load(rssUri);
    var rssFeed = from el in doc.Elements("rss").Elements("channel").Elements("item")
          select new { Title = el.Element("title").Value, Link = el.Element("link").Value,
          Description = el.Element("description").Value };
//The data is ready, assuming we have a ListView to display the Feed named lvFeed
//Lets bind the Feed to the ListView
    lvFeed.DataSource = rssFeed;
    lvFeed.DataBind();
//Thats all!
//C# Example: Fetch and Shape RSS Feed
    string rssUri = "http://some.feed.uri.xml";
    var doc = System.Xml.Linq.XDocument.Load(rssUri);
    var rssFeed = from el in doc.Elements("rss").Elements("channel").Elements("item")
          select new { Title = el.Element("title").Value, Link = el.Element("link").Value,
          Description = el.Element("description").Value };
//The data is ready, assuming we have a ListView to display the Feed named lvFeed
//Lets bind the Feed to the ListView
    lvFeed.DataSource = rssFeed;
    lvFeed.DataBind();
//Thats all!

Taken from http://www.haiders.net/post/C-RSS-Feed-Fetcher-Display-RSS-Feed-with-2-lines-of-Code.aspx

//www.haiders.net | Jan 2010
//C# Example: Fetch and Shape RSS Feed
    string rssUri = "http://some.feed.uri.xml";
    var doc = System.Xml.Linq.XDocument.Load(rssUri);
    var rssFeed = from el in doc.Elements("rss").Elements("channel").Elements("item")
          select new { Title = el.Element("title").Value, Link = el.Element("link").Value,
          Description = el.Element("description").Value };
//The data is ready, assuming we have a ListView to display the Feed named lvFeed
//Lets bind the Feed to the ListView
    lvFeed.DataSource = rssFeed;
    lvFeed.DataBind();
//Thats all!
Source Link

//C# Example: Fetch and Shape RSS Feed
    string rssUri = "http://some.feed.uri.xml";
    var doc = System.Xml.Linq.XDocument.Load(rssUri);
    var rssFeed = from el in doc.Elements("rss").Elements("channel").Elements("item")
          select new { Title = el.Element("title").Value, Link = el.Element("link").Value,
          Description = el.Element("description").Value };
//The data is ready, assuming we have a ListView to display the Feed named lvFeed
//Lets bind the Feed to the ListView
    lvFeed.DataSource = rssFeed;
    lvFeed.DataBind();
//Thats all!