scm0sml
asked on
getting the first 5 items in my xml datasource
I have the following on my .aspx:
<asp:XmlDataSource ID="xDS" runat="server"></asp:XmlDa taSource>
I then have in my code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim xmlDoc As New XmlDocument
xmlDoc.Load("http://www.shponline.co.uk/incourt-content/-/journal/rss/10704/55813?doAsGroupId=10704&refererPlid=10708")
xDS.Data = xmlDoc.OuterXml
xDS.DataBind()
xDS.XPath = "rss/channel/item"
rptNews.DataSource = xDS
rptNews.DataBind()
End If
End Sub
This works fine.
The only problem is that I only want to display the first 5 items.
Is there a simple way of doing this using the xmldatasource?
<asp:XmlDataSource ID="xDS" runat="server"></asp:XmlDa
I then have in my code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim xmlDoc As New XmlDocument
xmlDoc.Load("http://www.shponline.co.uk/incourt-content/-/journal/rss/10704/55813?doAsGroupId=10704&refererPlid=10708")
xDS.Data = xmlDoc.OuterXml
xDS.DataBind()
xDS.XPath = "rss/channel/item"
rptNews.DataSource = xDS
rptNews.DataBind()
End If
End Sub
This works fine.
The only problem is that I only want to display the first 5 items.
Is there a simple way of doing this using the xmldatasource?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
xDS.XPath = "rss/channel/item[position