开发者

How to make RSS feed as auto discoverable in asp.Net

开发者 https://www.devze.com 2023-01-12 22:16 出处:网络
In my asp.net 3.5 C# application I had RSS feed in some of myweb pages.I am using SyndicationItem object to prepare RSS feed and using 开发者_运维问答using System.ServiceModel.Syndication dll to prepa

In my asp.net 3.5 C# application I had RSS feed in some of my web pages.I am using SyndicationItem object to prepare RSS feed and using 开发者_运维问答using System.ServiceModel.Syndication dll to prepare RSS page. I want them to be auto discoverable i.e The RSS feed button in IE at the browser level should get highlighted when we go to the page with RSS feed. Let me know how to do this


It depends how you define auto discoverable.

If you are referring to the way a web browser will place an RSS feed icon in the address bar (like on SO) then you need to place the following code into the HEAD section of a web page the user is viewing:

 <link rel="alternate" type="application/atom+xml" title="Feed Title" href="http://rss-URL">

The code does not go in to the RSS feed. This approach will also allow search engines to find your feed.

It is also worth passing your feed via the http://validator.w3.org/feed/ as this will check it is valid and give you extra tips to ensure it is formatted in the best way.


You need to put the following meta tag into the header of your HTML page:

<link rel='alternate' type='application/rss+xml' title='RSS' href='/my_rss.html'>
0

精彩评论

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