Creating RSS feed in mvc3

In this toturial we are going through steps to create rss feed from a list of items using .NET’s built in SyndicatedFeed and SyndicatedItem class for content and two classes (Rss20FeedFormatter and Atom10FeedFormatter )  to handle XML generation with correct encoding, formatting and optional fields.

  1. Create an empty mvc3 application and name it “RSSFeed.Website” then add Home controller.
  2. Create a class and name it NewsItem  this class we will be used as a model for retrieving feed data from the database “i will fill it manually in a the next step ”
  3. Optional step, Fill in NewsItem list if you have items in database so there is no need to fill the list like that you can get the data from the database and return it in a list of items
  4. We have to build our FeedResult class
  5. We almost done we have to create our rss page so we are going to create an ActionResult called NewsRss in HomeController
  6. we are done now except just putting a link to home to open up our RSS

You can download a sample from here