Friday, 8 November 2013
Get RSS Feed to your Website
Hi,
Today I have Implemented this simple method to get the RSS feed from any other website. Usually this is used to get the Daily/Breaking/Latest News to your website.
So, Now i am going to explain how we can achieve this via simple coding.
<marquee behavious="scroll" direction="up" scrollamount="4" onmouseover="this.stop()" onmouseout="this.start()">
<div style=" text-justify: inter-word; text-align: justify">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="XmlDataSource1" >
<ItemTemplate>
<a target="_blank" href='<%# XPath("link") %>'>
<%# System.Web.HttpUtility.HtmlEncode(XPath("title").ToString())%></a>
<br />
<asp:Label runat="server" ID="lbl_desc" Text='<%#XPath("description")%>' ></asp:Label>
<%#XPath("pubDate") %>
<br />
<br />
</ItemTemplate>
</asp:Repeater>
</div>
</marquee>
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="http://feeds.feedburner.com/breakingtravelnews/news"
XPath="rss/channel/item"></asp:XmlDataSource>
Explanation:
In XmlDataSource => DataFile => URL where you want to get the News
XPath=> rss/channed/item => these are the nodes that defined in xml file for rss after that xml has "link" "description" "title" "pubDate" that i have used in repeater to get the Data.
Happy Coding :) :)
Today I have Implemented this simple method to get the RSS feed from any other website. Usually this is used to get the Daily/Breaking/Latest News to your website.
So, Now i am going to explain how we can achieve this via simple coding.
<marquee behavious="scroll" direction="up" scrollamount="4" onmouseover="this.stop()" onmouseout="this.start()">
<div style=" text-justify: inter-word; text-align: justify">
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="XmlDataSource1" >
<ItemTemplate>
<a target="_blank" href='<%# XPath("link") %>'>
<%# System.Web.HttpUtility.HtmlEncode(XPath("title").ToString())%></a>
<br />
<asp:Label runat="server" ID="lbl_desc" Text='<%#XPath("description")%>' ></asp:Label>
<%#XPath("pubDate") %>
<br />
<br />
</ItemTemplate>
</asp:Repeater>
</div>
</marquee>
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="http://feeds.feedburner.com/breakingtravelnews/news"
XPath="rss/channel/item"></asp:XmlDataSource>
Explanation:
In XmlDataSource => DataFile => URL where you want to get the News
XPath=> rss/channed/item => these are the nodes that defined in xml file for rss after that xml has "link" "description" "title" "pubDate" that i have used in repeater to get the Data.
Happy Coding :) :)
Thats an amazing content I must say..you had done a great job..
ReplyDeleteSAP FICO training in Lucknow
Fire and safety training in Lucknow
NDT training in Lucknow
PHP Training in Lucknow
JAVA Training in Lucknow
Android Training in Lucknow
HR Training in Lucknow
AutoCAD Training in Lucknow
Winter Training in Lucknow
REVIT Training in Lucknow
Great content you have share dI must say.. not only this but I have also shared your content to many sites.. thanks for it..
ReplyDeleteTop B.Tech Colleges In Lucknow
Private Engineering Colleges in Lucknow
List of Private Engineering Colleges in Lucknow
Best Medical colleges in Lucknow
Best Medical college in Lucknow
Colleges for Medical students in Lucknow
Best Engineering college for B.tech in Lucknow
I must say you have shared awesome content thanxx.. will share to other also