---
title: "Creating RSS feed for website"  
description: "RSS stands for Really Simple Syndication or it's sometimes referred to as Rich Site Summary.  It's an XML-based content format for distributing news,"  
author: "Anonymous User"  
published: 2012-06-04  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/311/creating-rss-feed-for-website  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# Creating RSS feed for website

RSS stands for Really Simple Syndication or it's sometimes [referred to as](https://answers.mindstick.com/qa/39930/at-the-turn-of-the-century-widespread-panic-occurred-that-at-midnight-all-computers-would-reset-to-zero-and-life-as-we-knew-it-would-cease-to-exist-what-was-this-doomsday-theory-commonly-referred-to-as) Rich Site Summary. It's an XML-based content format for distributing [news](https://www.mindstick.com/developersection/news), headlines, content, etc.\

Most popular sites news sites and [blogs](https://www.mindstick.com/developersection/blog) provide RSS feeds for you to subscribe to. All you need is a feed reader to view its contents. You can also create feeds for your own website so [your audience](https://answers.mindstick.com/qa/96461/what-s-another-way-to-show-you-pins-to-your-audience-without-always-linking-to-pinterest) can subscribe to them. If you update [your content](https://yourviews.mindstick.com/view/87465/how-to-enhance-your-content-visibility-10-tips) frequently and promote the feed effectively, it can help drive more steady [traffic to your](https://www.mindstick.com/articles/12865/infographic-drive-traffic-to-your-site-in-2018-10-hints) website.

There is some specific format from which you can create RSS feed. Let’s take a simple example, how to create RSS feeds for website.

Here I’m just creating a dynamic RSS page for [Articles](https://www.mindstick.com/articles/12872/how-to-write-articles-of-50-and-more-a-day-quick-and-easy), Blogs and Forums etc. With the help of this a user can bookmark either article sections, blogs section or forums sections.

##### To create a RSS feeds you start off the RSS file as follows:

```
<xml version="1.0" encoding="utf-8"><rss version="2.0"> <channel>
```

The first two lines specify the XML and RSS version as you can see. The third line opens a ‘channel’ tag. This is what would contain all the information for your channel or website.

##### Add these three lines as they are.

<title>[MindStick Software](https://answers.mindstick.com/qa/115570/what-is-mindstick-software-training-and-why-is-it-important) Pvt Ltd.</title>

<link>http://www.mindstick.com</link>

<description>MindStick Software Pvt Ltd.</description>

##### Example:

##### Code of RSS.aspx Page:

## ```
<%@ Page Language="C#" ContentType="text/xml" AutoEventWireup="true" CodeFile="RSS.aspx.cs"Inherits="LatestArticle_RSS" %><asp:repeater id="Repeater1" runat="server"><HeaderTemplate><rss version="2.0"><channel><title>MindStick Software Pvt Ltd.</title><link>http://www.mindstick.com</link><description>Unleash Your Imagination...</description><image><url>http://www.mindstick.com/Images/logo.jpg</url><title>MindStick Software Pvt Ltd.</title><link>http://www.mindstick.com</link><description>MindStick Software Pvt Ltd.</description><width>134</width><height>138</height></image></HeaderTemplate><ItemTemplate><item><title><%# Server.UrlDecode(RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "Title"))) %></title><link>http://www.mindstick.com/Articles/<%# DataBinder.Eval(Container.DataItem, "ArticleID") %></link><author><%# RemoveIllegalCharacters(DataBinder.Eval(Container.DataItem, "CreatedBy"))%></author><pubDate><%# String.Format("{0:R}", DataBinder.Eval(Container.DataItem, "CreationDate"))%></pubDate></item></ItemTemplate><FooterTemplate></channel> </rss></FooterTemplate></asp:repeater>
```

##### Code of RSS.aspx.cs Page:

##### \

```
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;public partial class LatestArticle_RSS : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {        SqlConnection sqlConn = new SqlConnection(“Your connection String”);        sqlConn.Open();        SqlCommand cmd = new SqlCommand("Write here your command for selecting data from database");            cmd.Connection = sqlConn;          Repeater1.DataSource = cmd.ExecuteReader();       Repeater1.DataBind();        sqlConn.Close();    }  protected string RemoveIllegalCharacters(object input)    {        // cast the input to a string          string data = input.ToString();// replace illegal characters in XML documents with their entity references          data = data.Replace("&", "&amp;");        data = data.Replace("\"", "&quot;");        data = data.Replace("'", "&apos;");        data = data.Replace("<", "&lt;");        data = data.Replace(">", "&gt;");  return data;    }} 
```

This is the complete description on creating RSS feed for website. I hope this article will help you in creating your RSS feeds.

---

Original Source: https://www.mindstick.com/blog/311/creating-rss-feed-for-website

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
