Thread: Show More Posts

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Show More Posts


    Hey guys, I'm showing blog posts from a table in sql in a descending order. I want to show a few posts on the page, and then a button at the bottom so that it expands and shows more. I tried a repeat region, showing 5 posts, but cannot figure out how to update the 5 to 10 and so on, incrementing in 5 posts whenever the button at the bottom is pressed. I've also tried removing the repeat region and doing a select top 10 using the id and descending, and trying to update that way but still no luck. Any ideas?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    103
    Rep Power
    9
    that is really depence from how youdesign your page. you can reload all posts with number of posts increased or just add more posts on existing page (preferred).
    you need to keep track of number of posts you showing on the page (somewhere in hidden field), when you click button "show more" you need to call another page using ajax or iframe and request from server 5 more posts. after get response from server add to div where you disloying posts your request results.
    make sure your query database something like
    select top (5) * from postsTable where postId not in (select top (5 * pageNumber) postID from postsTable )
    pageNumber is parameter which you will send when reguestion more posts

IMN logo majestic logo threadwatch logo seochat tools logo