Forum Moderators: open

Message Too Old, No Replies

Paging XML file

         

zxk105

12:55 am on Jan 29, 2005 (gmt 0)

10+ Year Member



I am trying to make a guestbook using XML and ADO.NET. Is it possible to do paging with XML? Over time the guestbook will grow. Therefore, I don't want to display all the entries on one page, but split it in 5 or 10 per page. What's the technique for doing this?

TheNige

1:04 am on Jan 29, 2005 (gmt 0)

10+ Year Member


How are you going to display the XML? You can load it into a dataset I believe and then use that to load a repeater, datalist, or datagrid.

The datagrid has built in paging but you can do it with the others with some work http://www.sitepoint.com/article/asp-nets-pageddatasource

zxk105

7:14 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



Good question........I should have said that right away. I do know that the DataGrid has built in paging option, but it won't work well with displaying the guestbook. I will most likely use the repeater b/c I want to display the info in this manner:

name:
date:
city/country:
message:

Thanks for the link.....I just did some quick reading and this might be what I'm looking for. I'll try and figure it all out.....thanks again.....

beauzero

2:45 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



Don't use either the repeater or the dataset. Too much overhead. Use an xslt style sheet. That way once you have to start paging you can leave the guest book in memory (XML file use caching and only update the cache when its been updated). Since you are using an xslt page then you can easily control the style...bring in the XML file from cache take a subset of the XML file (displaying page...i.e. according to the number of records you are displaying per page). To do this use an XML reader...much much faster and less overhead. If you don't have a lot of traffic on the site a repeater in fine. Avoid moving the xml file into the dataset everytime a person views the page. At the very least move the dataset into cache and use the dataset repeatedly. If you need some code samples let me know. Give me a detailed description of load, environment, and what you are trying to exactly do. I assume that you are writing to the XML file to avoid ASP/ISP charges on using database?

zxk105

7:25 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



Well there isn't much traffic on my site at all. The reason I am adding the guestbook is to simply add another feature to the site and get some excercise with XML. I have access to MS Access db but I really want to do this using XML. I guess the bottom line is that I'd like learn a lot while doing this. Which way do you suggest I should do this? If you have some sample code I can look at and learn from I'd definitely like to take a look....thanks.....

Jimmy Turnip

9:53 am on Feb 2, 2005 (gmt 0)

10+ Year Member



If you really want to learn xml from this, do as beauzero said and find out about xslt. Once you get your head round it, you'll find it's incredibly useful.