Forum Moderators: open

Message Too Old, No Replies

Paging with XML

         

zxk105

9:49 pm on Feb 23, 2005 (gmt 0)

10+ Year Member



I am pretty new with XML so I decided to create a Guestbook using C#.NET, XML, and XSLT to try and get a hang of it. Now I would like to include paging so only 10 messages are posted at a time. How do I select only a subset of the XML file that corresponds to the page being viewed?

Easy_Coder

1:35 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're binding your results to a DataGrid then take a look here:
[msdn.microsoft.com...]

Or if your just doing some client side binding you can set the datapage size like this:
<table id="tbl" datasrc="#xmlSource" datapagesize="10">

Your datasrc would need to walk back to your xml: <xml id="xmlSource">
Take a look here for more details: [w3schools.com...]

zxk105

3:08 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



I am simply transforming the XML file via XSL and XSLT and then using a StreamReader to output all the messages. So now I am trying to figure out how I can read & output only 10 messages at a time....

irnbru

8:35 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



Pass the start index and length of the result to your stylesheet.

Loop over the elements and use the position() function to write the correct set out.