Hi,
I have the code as in the following:
Sub submit(ByVal sender As Object, ByVal e As EventArgs)
songNodesOut.Text = String.Empty
Dim file As String = Context.Server.MapPath("alice_music_list2.xml")
Dim document As XmlDocument = New XmlDocument()
document.Load(file)
Dim songList As XmlNodeList
songList = document.SelectNodes("/music_songs/song[category='" & drop1.SelectedItem.Text & "']")
Dim songDisplay As XmlNodeList
songDisplay = document.SelectNodes("/music_songs/song[category='" & drop1.SelectedItem.Text & "'][position()<11]")
Dim count As Integer = songList.Count
Dim page AS Decimal = songList.Count/10
Dim IntegerPart As Integer= Int(page)
Dim DecimalPart As Decimal = page - IntegerPart
if(DecimalPart >0) Then
IntegerPart+=1
End If
mess.Text = "<p>You selected <b>" & drop1.SelectedItem.Text & " " & count & " items</b>. That is " & IntegerPart & " pages</p>"
Dim song As XmlNode
For Each song In songDisplay
Dim title As XmlNode = song.FirstChild
songNodesOut.Text &= "<br /><b>Title:</b> " & title.InnerText & "<br/>"
Dim category As XmlNode = title.NextSibling
songNodesOut.Text &= "<b>Category:</b> " & category.InnerText & "<br />"
Dim album As XmlNode = category.NextSibling
Dim artist As XmlNode = album.NextSibling
songNodesOut.Text &= "<b>Artist:</b> " & artist.InnerText & "<br/>"
songNodesOut.Text &= "<b>Album:</b> " & album.InnerText & "<br />"
Dim date1 As XmlNode = artist.NextSibling
Dim dateAttribute As XmlAttribute = date1.Attributes("added")
songNodesOut.Text &= "<b>Date Added to Collection:</b> " & dateAttribute.Value & "<br/><hr/>"
Next
End Sub
I am trying to use this to use as a paginating system, is there anything else I need to do here to able to let my system know what page it is on to print out the next set of results?
Right now I am using
songDisplay = document.SelectNodes("/music_songs/song[category='" & drop1.SelectedItem.Text & "'][position()<11]")
, I am hoping to make this dynamic so that it would add up 10 by itself. What type of function do I need here to achieve this? For loop? For each? I am using this with ASP.NET.
Thanks for your help.