Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hi I am using this code to get RSS Feed in my asp.net website and it work very good but it get feed only from one website i want to display feeds from more then website in same time pls help me

C#
string x = "http://www.codedigest.com/Articles/Rss.ashx";

           XmlTextReader reader = new XmlTextReader(x);
           DataSet ds = new DataSet();
           ds.ReadXml(reader);
           DataList1.DataSource = ds.Tables["item"];
           DataList1.DataBind();


ASP.NET
<asp:DataList ID="DataList1" runat="server" Width="100%">
    <ItemTemplate>
                <div class="RSSTitle"><asp:HyperLink ID="TitleLink" runat="server" Text='<%# Eval("title") %>' NavigateUrl='<%# Eval("link") %>'/></div>
                <div class="RSSSubtitle"><asp:Label ID="SubtitleLabel" runat="server" Text='<%# Eval("description") %>' /></div>
                <div class="RSSInfo">
                    posted on <asp:Label ID="DateRSSedLabel" runat="server" Text='<%# Eval("pubDate", "{0:d} @ {0:t}") %>' />
                </div>
    </ItemTemplate>
</asp:DataList>


Thank You...
Posted

1 solution

Not much familiar with the RSS feed with ASP .NET, but here's a thing you can do (Basic Idea) -

1. Get RSS Feeds from different URLs and maintain DataTable foreach feed.
2. Club all the DataTables in a new DataTable. Use DataTable.Merge Method[^] for that. (Example[^])
3. And then bind that new DataTable with the DataList.


-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900