User Id :    Password :      New Member   Forgot Password  
How we can consume/read RSS of a site in
Description In this article I am going to explain what is RSS and how we can consume/read RSS of a site in   No. of Views     2079
  Rating     0
Author Najmul Hoda   Posted On     16 Oct 2011
Tags ASP.NET    

Sample Code   Download Code




In this article I am going to explain what is RSS and how we can consume/read RSS of a site in our website using

Here we will cover following topics

1) whats is RSS
2) How it can helps us
3) How we can consume/read RSS in our application in

What is RSS

RSS, short form of "Really Simple Syndication". It is a way to easily distribute/publish updated works such as  list of headlines, update notices, and blog entries to a wide number of people in a standardized format. These RSS feed are then used by computer programs that organize those headlines  for easy reading.

How it helps us

Many people are interested in some website where the contents of the website changes regularly. for example community site, weblogs, health care, job portals and news sites. Using RSS of these sites you can easily stay informed by retrieving the latest content from these sites. You will save time by not visiting each site individually also you need not to join each site's email newsletter to get the latest content from these sites.

How we can consume/read RSS in our application in

Now if someone is interesred in latest articles published in or any other site, he can simply integrate RSS feed in his website and will be get informed without visiting or the site he is interested in.

Here I will show you how you can consume/read and integrate RSS feed of in your website.

In the below image you can see the RSS from


When you right click on this page you will get xml code as RSS feed is an XML file.


 <rss version="2.0">
  <title>DotNetLogix Latest Articles</title> 
  <description>Latest Articles From DotNetLogix</description> 
  <copyright>Copyright &copy; DotNetLogix, 2010-2011</copyright> 
  <lastbuilddate>10/16/2011 12:00:21 PM</lastbuilddate> 
  <title>Creating a Breadcrumb like Menu using CSS and JQuery</title> 
  <description>Creating a Breadcrumb like Menu using CSS and JQuery</description> 
  <author>Najmul Hoda</author> 
  <pubdate>Sun, 02 Oct 2011 11:32:18 GMT</pubdate> 
  <title>Take Backup of a DataBase By Coding</title> 
  <description>In this article I am going to show how we can show all Data Server in a network and on selecting a Data Server.</description> 
  <author>Rahul Saxena</author> 
  <pubdate>Sun, 02 Oct 2011 00:59:53 GMT</pubdate> 
  <title>Replicate function in Sql Server</title> 
  <description>Replicate fucntion in Sql server repeats a string for a number of times specified by the user.</description> 
  <author>Najmul Hoda</author> 
  <pubdate>Tue, 27 Sep 2011 12:24:41 GMT</pubdate> 


In the above XML file we need only item tags and tags inside it.  Now lets integrate RSS feed in our web application

Step1 . Create a new page called readRSSFeed.aspx
Step2 . Drag and drop XMLDatasource data control from toolbar to aspx page and configure the propertise of the XMLDataSource as below.


<asp:xmldatasource id="XmlDataSource1" datafile="" runat="server">

Step3 . Now to show RSS feed in proper format we can use different DataSources such as GridView, Repeater, ListView, DataList. For our example we will use ListView.

I am declaring here a ListView to show RSS data and formating it to show data in proper format.


            <b>Latest Articles From DotNetLogix </b>
            <asp:listview id="lstViewRSSFeed" datasourceid="XmlDataSource1" runat="server">
                    <div style="background-color: rgb(204, 204, 204); font-size: 12px; border: 1px solid black; padding: 5px;">
                            <b>Title :</b>
                            <b>Url:</b> <a href='<%#XPath("link")%>' > <%#XPath("link")%>
                            <b>Desc: </b>
                            <b>Author :</b>


Step4. Now run the page we you get something like below image.

When you run, in the webpage you will see 20 articles. If you want to limit the list of items to 5 or 10 then you can set that limit in the XMLDataSource  like below


<asp:xmldatasource runat="server" xpath="rss/channel/item [position()<=5]" datafile="" id="XmlDataSource1">

In the above code you can see I have set XPath value to "rss/channel/item [position()<=5]". It tells the XMLDatasource to get top 5 items from the list.

Hope it will help you. Stay connected for more....

Now I am going in compilation mode......................  Happy Reading.......


About Author

About Author He is a team lead, having 8+ years of experience. He loves writing technical article for .Net developers. Najmul Hoda
No Photo
Country United States
Company BirlaSoft
Home Page

Rate this article

Rating options from poor, fair, good, very good to excelent.  


Write your comment here.
Verification Code