troubleshooting Question

implementing paging in xml data using a DataList (.NET 2.0)

Avatar of AidenA
AidenA asked on
2 Comments1 Solution391 ViewsLast Modified:
Hi, I was looking the web for info on this but couldn't get it working. I got as far as below

 <asp:DataList  ID="DataList1"  runat="server" style="border:1px solid; border-color:#68affd;"></asp:DataList>

Codebehind: I've removed a bit of the code to just show the loading.
Private Sub LoadXML()

        Dim Items As New Data.DataSet()

        'creating the PagedDataSource instance....
        Dim pg As New PagedDataSource()
        Dim dv As New Data.DataView(Items.Tables(0))

        pg.DataSource = dv 

        pg.AllowPaging = True
        pg.PageSize = 1

        pg.CurrentPageIndex = 0
        'pg.CurrentPageIndex = CurrentIndex

        'The currentpage
        lblIndex.Text = "Page: " + (CurrentIndex + 1).ToString() + " of " + pg.PageCount.ToString()

        'Button status
        'Button1.Enabled = Not pg.IsFirstPage
        'Button2.Enabled = Not pg.IsLastPage

        'Binding pg to datalist
        DataList1.DataSource = pg 'dl is datalist

    End Sub

The problem that I'm having there is that nothing is returned at all even though the xml page does have data on it. What am I doing wrong there do you know?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros