Tuesday, July 7, 2009

RSS feed particular Item display in a gridview

<div>

<asp:GridView ID="bank" Runat="server" DataSourceID="xds" AutoGenerateColumns="False" AllowPaging="True" >

<

Columns>

<

asp:TemplateField>

<

ItemTemplate>

<asp:HyperLink ID="HyperLink1" Runat="server" Text='<%# XPath("title") %>' NavigateUrl='<%# XPath("link") %>'

Target="_blank" Font-Names="Verdana" Font-Size="X-Small">

</asp:HyperLink>

</

ItemTemplate>

</

asp:TemplateField>

</

Columns>

</

asp:GridView>

<

asp:XmlDataSource ID="xds" Runat="server" DataFile="http://rss.news.yahoo.com/rss/topstories"

XPath

="rss/channel/item [position()=2]">

</

asp:XmlDataSource>

</div>

No comments: