开发者

What's the easiest way to create a feed in asp.net?

开发者 https://www.devze.com 2023-01-20 16:16 出处:网络
I want to provide some dynami开发者_如何学Pythonc content like an rss feed, so when they go to mydomain.com/fishcake.rss it runs some code on the server to generate it and returns it back.

I want to provide some dynami开发者_如何学Pythonc content like an rss feed, so when they go to mydomain.com/fishcake.rss it runs some code on the server to generate it and returns it back.

I am guessing maybe an ashx file and something in the webconfig to associate it with the path I want, but I'm not totally sure. Can you help?


Although the two answers until now are both good, I think your question is more about the dynamic part, rather than the feed structure itself. And you actually answered that yourself. The ASHX file is called an Http Handler, and that's the way to go about delivering dynamic content. Here's some more info:

http://msdn.microsoft.com/en-us/library/ms972953.aspx


The easiest way would be to use a library designed to create feeds. I have used the Argotic Syndication Framework with success in the past.

Here is a link with a sample for creating an RSS feed with Argotic.


If you want to use out of the box .NET libraries, check out SyndicationFeed.

Here's a good example of how to Create a Basic RSS Feed.

(The example shows how that class can fit in with WCF, but the basic principles and code are there.)

0

精彩评论

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