Search code examples
paginationasp.net-ajaxajaxcontroltoolkit

Twitter style paging in ASP.NET AJAX?


I have a user control with a DataList in it. I want the list to show only the first 20 records, with a "more" link at the bottom. If the user clicks more, asynchronously load 20 more records below the previous records, without postback. Is it possible to accomplish with stardard Microsoft AJAX without using something like jQuery?


Solution

  • No one has responded, and this is the closest thing I can find about this:

    http://joelabrahamsson.com/entry/twitter-style-paging-with-aspnet-mvc-and-jquery

    The only way I could make this work was to completely restructure my page -- forego using web UserControl's. Forego using UpdatePanel's and server side UI controls such as DataList. I wrote everything in client side javascript using jQuery, and did my own AJAX calls. Works MUCH better now. Now I can simply do an AJAX call to a static [WebMethod] on my server, and have it return the messages, and then just do a:

    $('#messagesdiv').append(msgHtml.d)
    

    and have jQuery just dynamically update the DOM with the new HTML for the new messages. Of course, it's a little more complicated than that, but you get the idea, I hope.