objectdatasource with paging enabled selecting twice

Last post 06-02-2008 11:54 AM by Philwith. 0 replies.

Sort Posts:

  • objectdatasource with paging enabled selecting twice

    06-02-2008, 11:54 AM
    • Member
      point Member
    • Philwith
    • Member since 06-02-2008, 11:29 AM
    • Posts 5

    Hi

    I'm having a problem getting paging to work efficiently with an objectdatasource control.  I have it configured so that paging is using a querystring parameter rather than a postback.  When I go to a url e.g. http//localhost/Search.aspx?Query=Something&Page=2, my objectdatasource's "SelectMethod" gets called twice. 

    The method signature looks like this

    Public Function GetResults(ByVal query As String, ByVal maximumRows As Integer, ByVal startRowIndex As Integer) As List(Of DocumentResult)

    The difference between the two calls is that on the first occasion, startRowIndex = 0 and on the second occasion it is the correct value (in this case 10).  Incidentally, the "SelectCountMethod" also gets called twice, after each "SelectMethod".

    Does anyone have any ideas as to where I might have gone wrong?

    Thanks in advance

    Phil

     

     

Page 1 of 1 (1 items)