5,696,038 members and growing! (10,993 online)
Email Password   helpLost your password?
Languages » XML » General     Intermediate

RSS Feed using ASP.NET 2.0

By mssoni

This RSS Feed example will explain how to consume an RSS Feed in eight easy steps..!
XML, VBWindows, .NET, .NET 2.0, Win2K, WinXP, Win2003, Vista, IIS, IE, ASP.NET, WebForms, VS2005, Visual Studio, Dev

Posted: 9 Jan 2006
Updated: 9 Jan 2006
Views: 46,357
Bookmarked: 38 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
16 votes for this Article.
Popularity: 4.29 Rating: 3.56 out of 5
2 votes, 12.5%
1
0 votes, 0.0%
2
3 votes, 18.8%
3
4 votes, 25.0%
4
7 votes, 43.8%
5

Introduction

This article will explain how to consume an RSS Feed from another website using ASP.NET 2.0. I have tried to keep this article very simple so that even beginners can easily understand this. This article will explain to you how to use RSS Feeds in eight easy steps using ASP.NET 2.0!

Background

Before you start reading/implementing the steps using this article, hope you are aware of RSS Feeds. RSS means Really Simple Syndication. Nowadays, every dynamic web site, has this feature named RSS. Using RSS Feeds, you can be in sync with the changes/additions made to your favourite shopping website or your favourite techie blog website.

Using the code

OK. Let's start. Please follow the following seven easy steps and your RSS Feed webpage will be ready to consume RSS from a given website:

  1. Start -> Programs -> Microsoft Visual Web Developer 2005 Express Edition.

  2. Now, go to File -> New Website to create a new website. Select Location=File System, Language=Visual Basic, and give the default web site path (by default, it will create a new website at C:\Documents and Settings\default\My Documents\Visual Studio 2005\WebSites).

  3. Then, drag the XMLData source component from Toolbox -> Data -> XMLDataSource to the blank WebForm.

  4. Click on XMLDataSource Tasks - > Configure Data Source link to configure the data source. Now, this is the actual thing in the whole project.

  5. Then, you will see the ConfigureDataSource window which has the following paths to be specified to consume the XML data:
    • Data File = Data file will be your RSS Feed path. In my case, it is http://spaces.msn.com/members/mauliksoni/feed.rss.
    • Transformation File = we are not currently using any XML transformation file, so leave it blank.
    • XPath Expression = again, this is very much important. An XPath variable will be used later on in our code to get the specific RSS Feed link. Give it as rss/channel/item now.
  6. The next step is to drag the DataList control from Toolbox -> Data -> DataList to the WebForm.

  7. Then, click on the Choose Data Source dropdown for the DataList and select XMLDataSource1.

  8. And then the final step. Switch to the HTML Source View of the WebForm and paste the following code:
    <ASP:DataList...> 
     <ItemTemplate> 
     </ItemTemplate> 
    </ASP:DataList>

    And then, press F5 in your project to Run the project. Please refer the example source file for any further details.

Info

Q-1. How should I obtain the RSS feed path?

Ans. You will require a path to the RSS Feed from any given website to actually consume the RSS Feed of that website. In my example, I have used http://spaces.msn.com/members/mauliksoni/feed.rss, but you can use any RSS path. To get the RSS feed path from any website, try to locate the word RSS or look for its image in the website. Then click on RSS or XML, your browser will be redirected to the XML formatted page. Now copy the link form IE.

History

N/A

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

mssoni


My name is Maulik Soni. I live in Columbus, OH. I am working as an IT Consultant since last 6 years. I have various certifications like OOAD – UML Certification from Rational and MCP.

My Area of interest in Software Development is ASP.NET, VB.NET, XML, SOAP, WEBSERVICES, and AJAX. I also enjoy Database Design work sometime.

I also have a tech-blog at Maulik Soni

Mail me: soni.maulik@gmail.com

Occupation: Web Developer
Location: United States United States

Other popular XML articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 12 of 12 (Total in Forum: 12) (Refresh)FirstPrevNext
GeneralHow to Combine Rss Feed data comes from more than one rss feed?memberYadav A Kumar8:10 11 Nov '08  
GeneralRss filememberumeshdaiya23:16 15 Jul '08  
GeneralRSS Feed detailmemberaspmike11:53 5 Mar '08  
GeneralUnable to locate RSS feed...memberkrishnaveer21:00 13 Nov '07  
GeneralDoesnt workmemberDarynRoberts0:27 20 Aug '07  
GeneralShow only last x postsmemberFalkenberg4:39 30 Jan '07  
GeneralMy Forum RSS FeedmemberRadioButton13:59 30 Jun '06  
GeneralRSS Feed doesn't work, once deployed in the IISmemberDilumt0:06 4 May '06  
GeneralRe: RSS Feed doesn't work, once deployed in the IISmembermssoni4:23 4 May '06  
GeneralRe: RSS Feed doesn't work, once deployed in the IISmemberDilumt18:13 4 May '06  
GeneralRe: RSS Feed doesn't work, once deployed in the IISmemberKanedogg0820:01 26 Dec '07  
JokeRSS ToolkitmemberMohamed A. Meligy19:56 1 May '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Jan 2006
Editor: Smitha Vijayan
Copyright 2006 by mssoni
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project