| Author: vipul 09 Aug 2008 | Member Level: Diamond | Rating: 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
|
| Author: Vidhya 09 Aug 2008 | Member Level: Gold | Rating: 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 2008 | Member Level: Gold | Rating: 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
|