Rss feed

I am showing a rss feed in a listview in asp.net 3.5.Currenly I am
showing everyitem,but I would like to show top 5 articles.I am giving
my code below.




XDocument feedXML = XDocument.Load("http://
feeds.encosia.com/Encosia");
var feeds = from feed in feedXML.Descendants("item")
select new
{
Title = feed.Element("title").Value,
Link = feed.Element("link").Value,
Description =
feed.Element("description").Value
};

PostList.DataSource = feeds;
PostList.DataBind();
Here PostList is the id of the listview .Can anybody sujjest How I
would able show the top 5 articles.?
arnabit [ Di, 22 April 2008 08:52 ] [ ID #1947360 ]

Re: Rss feed

If you are using .NET 3.5, you can use System.ServiceModel.Syndication
namespace to handle RSS.

You need not handle it yourself with XML.

--
Madhur

"Arnab das" <arnabit [at] gmail.com> wrote in message
news:b8d836d6-e1e0-4ca3-a862-aef0cce10d26 [at] p25g2000hsf.google groups.com...
>I am showing a rss feed in a listview in asp.net 3.5.Currenly I am
> showing everyitem,but I would like to show top 5 articles.I am giving
> my code below.
>
>
>
>
> XDocument feedXML = XDocument.Load("http://
> feeds.encosia.com/Encosia");
> var feeds = from feed in feedXML.Descendants("item")
> select new
> {
> Title = feed.Element("title").Value,
> Link = feed.Element("link").Value,
> Description =
> feed.Element("description").Value
> };
>
> PostList.DataSource = feeds;
> PostList.DataBind();
> Here PostList is the id of the listview .Can anybody sujjest How I
> would able show the top 5 articles.?
Madhur [ Di, 22 April 2008 13:59 ] [ ID #1947370 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Rss feed

Vorheriges Thema: previous master page question
Nächstes Thema: GridView CommandArgument suddenly stopped working