Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hello friends,

In my application i have used the RSS feed. i have used the following code
 

 
<div class="news-blog">
            <h4>
                News and events<div class="news_scroll">
                    <asp:LinkButton ID="btnDown" runat="server" onclick="btnDown_Click"></asp:LinkButton>
 
                    <asp:LinkButton ID="btnUp" runat="server" onclick="btnUp_Click"></asp:LinkButton>
                    </div>
            </h4>
            <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://www.gatesfoundation.org/FileReturn.aspx?returntype=rss&feed=all"
                XPath="rss/channel/item [position()<=3]"></asp:XmlDataSource>
 
            <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1">
                <ItemTemplate>
                    <div class="news-events">
 
                        <table width="100%">
                            <tr>
 
                                <td>
                                    <div class="news-content">
                                        <h5>
 
                                    <asp:HyperLink ID="hypTitle" runat="server" Width="500px" Text='<%# XPath("title") %>'
                                        Target="_self" NavigateUrl='<%#XPath("link")%>'></asp:HyperLink>
                                </h5> </div><br />
                                <p>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="Label1" runat="server" Text='<%# XPath("description") %>'
                                        Style="float: right"></asp:Label>
                                </p>
                                </td>
                            </tr>
 
                        </table>
                        <br />
                    </div>
                </ItemTemplate>
            </asp:DataList>
 

 

 

from this i have shown the 3 news. but when i click on up button i want to the news from 2nd to 4th.in code behind i don't understand how can i change the positions of the news. i want just like XmlDataSource1.XPath = "rss/channel/item [position()<=3 && position()!=1]"; but it gives error. please help me.
Posted 18-Nov-12 19:58pm
Edited 18-Nov-12 20:10pm
v2

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

  Print Answers RSS
0 OriginalGriff 405
1 Peter Leow 225
2 Sergey Alexandrovich Kryukov 210
3 Maciej Los 195
4 DamithSL 194


Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 19 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid