Thursday, April 20, 2006

Dynamic XML

Today I was playing round with rss feeds. Never used them before so i first wrote a static rss feed, saved as xml and worked fine :D

Next i tried writing some c# code to generate RSS on the fly and had problems!

Things to remeber for dynamic rss in .net

  • Make sure every dynamic item has a title, description and a link tag with a VALID link
  • make sure the header of your page has ContentType="XML" example...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dynamicfeed.aspx.cs" Inherits="Syndication_Dynamicfeed" ContentType="XML"%>
  • If you do not set the content type, then any rss aggregators think the aspx file is xhtml and not a valid xml feed. without the ContentType attribute, your rss is invalid.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home