Tagged with ashx

Publish Rss feed using the Syndication namespace

Here’s an easy way to expose feeds using the new System.ServiceModel.Syndication namespace. Instead of dealing with XmlDocument the Rss20FeedFormatter class will be responsible to format the correct xml content for our feed. 1: SyndicationFeed feed = GetSyndicationFeed(); 2: Rss20FeedFormatter rssFormatter = new Rss20FeedFormatter(feed); 3: using (XmlWriter writer = XmlWriter.Create(context.Response.OutputStream)) 4: { 5: rssFormatter.WriteTo(writer); 6: writer.Flush(); … Continue reading