Thursday, November 6, 2008

RSS (How to use RSS in ASP.NET)

RSS stands for (Really Simple Syndication). Basically RSS feeds are xml files which are provided by many websites so you can view their contents on your own websites rather than browsing their site. Suppose you are a movie lover and you want to get the list of top 5 movies from 10 websites. One way will be to visit all 10 websites and see the top 5 list. This method though is used in general by lot of people but its quite tiring method. It will take you 10-15 minutes to browse all the websites and see the top 5 list of movies. One easy way will be if those movie websites provides RSS feeds to be used by the users. If they provide RSS feeds you can embed them in your page and now you don't have to browse all the websites since the information is available on a single page. Hence, this saves you a time and a lot of browsing.

Most of the Blogs websites provide RSS feeds so you can embed your or someone's else latest entries of blog on your website. In this article we will see how we can embed RSS feeds to our webform using

create a gridview and a button on page and write following code...u will be able to access RSS of MSDN

you can replace this link with any other link of RSS of any other site...
just go to site and click on RSS link then that link will take u to a xml file for that RSS then copy that address and paste in XmlTextReader ( code.

using System.Xml;

protected void Button1_Click(object sender, EventArgs e)
  XmlTextReader reader = new XmlTextReader("");  //this is address of RSS xml file
        DataSet ds = new DataSet();
        GridView1.DataSource = ds.Tables[2];

Share This!

No comments:

Powered By Blogger · Designed By Seo Blogger Templates