如何在 asp.Net 中使 RSS feed 自动发现

发布于 2024-09-15 18:27:45 字数 206 浏览 5 评论 0原文

在我的 asp.net 3.5 C# 应用程序中,我的一些网页中有 RSS 提要。我使用 SyndicateItem 对象来准备 RSS 提要,并使用 System.ServiceModel.Synspiration dll 来准备 RSS 页面。 我希望它们能够自动发现,即当我们转到带有 RSS feed 的页面时,浏览器级别的 IE 中的 RSS feed 按钮应该突出显示。让我知道该怎么做

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

万劫不复 2024-09-22 18:27:45

这取决于您如何定义自动发现。

如果您指的是网络浏览器在地址栏中放置 RSS 提要图标的方式(如 SO 所示),那么您需要将以下代码放入用户浏览的网页的 HEAD 部分正在查看:

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

代码不会进入 RSS 提要。这种方法还可以让搜索引擎找到您的提要。

通过 http://validator.w3.org/feed/ 传递您的 Feed 也是值得的因为这将检查它是否有效并为您提供额外的提示以确保它以最佳方式格式化。

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.

独自唱情﹋歌 2024-09-22 18:27:45

您需要将以下元标记放入 HTML 页面的标头中:

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

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'>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文