Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate RSS using Asp.Net

Tags:

c#

asp.net

rss

I use Asp.net Web Forms and C# 4.

I have content in DataBase table and I would like publish it as RSS for my website.

My questions:

  • Does Asp.Net framework provide a namespace or tool to automatically doing it?
  • In case no, could you point me out a good tutorial or tool?
  • I read the article: http://weblogs.asp.net/scottgu/archive/2006/02/22/Awesome-ASP.NET-2.0-RSS-Tool_2D00_Kit-Released.aspx this tool is for Asp.Net 2.0 could be used nowadays or is out of date?

Thanks

like image 742
GibboK Avatar asked Aug 29 '11 05:08

GibboK


People also ask

What is RSS and how do I use it?

With blogs or news sites being updated frequently, and with the vast amount of blogs and news websites out there, RSS has allowed readers to keep up with new content without being forced to visit them. Once you've completed this tutorial, you'll know how to create an RSS feed with ASP.NET, and how to render XML documents on ASP.NET Web pages.

How do I create a custom RSS page in Visual Studio?

In Solution Explorer, right-click the project name, and then click Add New Item. In thia dialog box, under Visual Studio installed templates, click Web Form. In the Name box, type a name for the new Web page ( rss.aspx ), and then click Add. The new ASP.NET web page ( rss.aspx) is created and displayed, accordingly.

How to parse the RSS feed results?

An RSS Feed is generally used to return the output in plain text or XML format. To parse the results from our application we use the RSS feed result that can be easily parsed. We have a tag format for the RSS.

How to pull RSS from a website using xmlTextReader?

The whole idea is to create a Web Request and Web Proxy to the website from where the RSS needs to be pulled. The received Web Response is then read using the XmlTextReader and finally the contents of the XmlTextReader into the DataSet using the ReadXml property.


2 Answers

Don't do it by hand - use the built-in System.ServiceModel.Syndication classes to generate the feed for you. Then you know it's compliant with whichever format (RSS or ATOM) you generate.

Here's an article that walks you through it:

[How to create a syndication feed for your website][1]

[1]: http://dotnetslackers.com/articles/aspnet/How-to-create-a-syndication-feed-for-your-website.aspx [NOT WORKING]

like image 110
Matt Hamilton Avatar answered Oct 04 '22 08:10

Matt Hamilton


Well, MSDN has a relatively-straightforward tutorial on how to generate RSS 2.0 from ASP.NET, found at http://msdn.microsoft.com/en-us/library/aa478968.aspx. It's really not terribly hard, so I would recommend doing it if you're wanting to learn something.

like image 25
Tieson T. Avatar answered Oct 04 '22 08:10

Tieson T.