Recently I was working on providing and consuming an RSS feed for a Silverlight project. One of the handy (but often overlooked) things possible with asp.net is the ability to set the content type at the page level. So using that trick along with a SqlDataSource and a repeater, you can put together a RSS feed (admittedly a very simple one) in as single aspx file – no code behind needed.
<%@ Page Language="C#" ContentType="text/xml" %> <asp:repeater runat="server" DataSourceId="sdsFeed"> <HeaderTemplate> <rss version="2.0"> <channel> <title>QuickRss Test Feed</title> <link>http://quisitive.net/feed</link> <description>This is the feed description.</description> </HeaderTemplate> <ItemTemplate> <item> <title><%# Eval("title") %></title> <description><%# Eval("description") %></description> <pubdate><%# Eval("pubdate") %></pubdate> </item> </ItemTemplate> <FooterTemplate> </channel> </rss> </FooterTemplate> </asp:repeater> <asp:SqlDataSource ID="sdsFeed" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT title, description, pubdate FROM rssData"> </asp:SqlDataSource>
Calling the page above results in the following simple RSS feed.

Although this is not exactly a Silverlight tip, it may come in handy.

One of the questions that seems to come up quite often is something along the lines of “Now that you have built one, what will you do differently on the next one?” While I really like how my tear came out, I have been thinking allot on that question and came up with the following, rather long, list (in no particular order):