RSS C# Class

Sometimes I love C#/Visual Studio/ASP.NET.  Then other times, not so much.

I wanted to create a simple RSS feed for my C#/ASP.NET site and there really wasn’t anything out there.  I really don’t want to download anybody else’s binary files and I wanted something simple.

It was almost super easy.  Then I got hung up on UTF-16 vs UTF-8.

So I made my own RSS class.  Here it is. RSS CLASS

It’s only about 100 lines.

If you want to have an RSS Feed on a .Net web page, here’s the code for that.

protected void Page_Load(object sender, EventArgs e)
    RSS rss = new RSS(“Geiger”, “”, “Geiger”, DateTime.Now.ToShortDateString());
    rss.Add(“Geiger 1″, “″, “Geiger Description 1″, “1″);
    rss.Add(“Geiger 2″, “″, “Geiger Description 2″, “2″);

    Response.ContentType = “text/xml”;

Google LOVES blogs.  So if you have a .net site, add RSS to it!

Leave a Reply

Your email address will not be published. Required fields are marked *

seven + 9 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>