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:
Thanks
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.
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.
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.
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.
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]
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With