C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Implementing RSS feed in Asp.Net


Posted Date: 08 Aug 2008      Total Responses: 3

Posted By: suresh       Member Level: Silver     Points: 1



Hi:
I have a task of implementing RSS feed in my Asp.Net project.But i have no idea about it.Can any one give me suggestion and code to implement RSS in Asp.Net application.Do i have to download RSS0.91 ? and add it in Asp.Net application if so how to call that rss feed in to .aspx page,plz consider this mail as very urgent and convey ur suggestion.


Thanks:





Responses

Author: vipul    09 Aug 2008Member Level: DiamondRating:     Points: 3

hi,
for that you used this link in this i used Rss and you downaload code also.
http://www.dotnetspider.com/resources/Index.aspx?UserId=dongavipul

vipul,
http://dongavipul.blogspot.com

Patel Vipul
Web Developer
Ahmedabad ( Gujarat )



Author: Vidhya    09 Aug 2008Member Level: GoldRating:     Points: 6

hi,

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>

<ItemTemplate>
<%#Path("title")%>
<hr color="#0099ff" /> <br />
<%#Path("description")%><br />
</ItemTemplate>

And then, press F5 in your project to Run the project.

Note:
Kindly rate this content if it helps!



Author: Gaurav Arora    09 Aug 2008Member Level: GoldRating:     Points: 6

Hi
Above is very good but there is some mistakes, I have put here rewritten code:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://spaces.msn.com/members/mauliksoni/feed.rss"
XPath="rss/channel/item"></asp:XmlDataSource>
</div>
<asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
<ItemTemplate>
<%#XPath("link")%>
<hr color="#0099ff" />
<br />
<%#XPath("description")%>
<br />
</ItemTemplate>
</asp:DataList>
</form>
</body>
</html>


Please rate Vidhya's article it has worth.

Enjoy development!
Thanks & regards,
Gaurav Arora

Thanks & regards,
Gaurav Arora
Lets Share Knowledge...



Post Reply
You must Sign In to post a response.
Next : conversion from dcox into html
Previous : XML
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use