开发者

How to create an RSS feed?

How do I create an RSS feed in ASP.NET?

Actualy I want to output like this. Clik on an RSS icon, open the 开发者_运维百科RSS bookmark box and subscribe the user. After that, clik on the RSS feed link, create RSS bookmark to show RSS, update data.


At the end of the day an RSS feed is an XML document that adheres to a predefined schema. So in the simpliest terms all you need to do is populate that XML and make it accessible to web users. You can also put information in the head of your web page markup to inform the browser that an RSS feed is available to them (this is optional).

You have a couple of options depending on the .NET framework version you are using:

.NET 2 : Get hold of the RSS XML schema you want to work with and populate as you would with any XML document.

.NET 3.5 : 3.5 introduced System.ServiceModel.Syndication, this wraps up the various RSS formats that are available and makes the process of creating your feed much easier. An example of working with these classes can be found here:

http://predicatet.blogspot.com/2009/05/create-rss-feed-natively-with-net-35.html

More information on the Syndication namespace can be found here:

http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.aspx

Finally, as you develop your feed you can use the following to validate your XML:

http://validator.w3.org/feed/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜