0

I have a controller that returns a list of friends (over 100 friends). I want to display the first ten friends and if I click on a button (View More / Display all).

How can I do this? Can Ajax or jQuery do this? (I have never used either.)

Mat
  • 202,337
  • 40
  • 393
  • 406
  • 1
    if you are already getting list of all the friends then showing only 10 at a time does not makes a sense. rather write a controller that takes a parameter like `page_number` and returns you list of 10 friends that will come under that page. – TheVillageIdiot May 25 '12 at 04:59
  • @TheVillageIdiot can you give me an example thank you, I use a template to show friends what I want is to do like facebook each time displaying more friends – saisneImane May 25 '12 at 05:12

1 Answers1

0

You can look into using MVC's WebGrid. It has built in paging and sorting (also with Ajax support)

TGH
  • 38,769
  • 12
  • 102
  • 135
  • Maybe this is a start http://stackoverflow.com/questions/4342578/razor-webgrid-ajax-paging-and-sorting – TGH May 25 '12 at 05:05
  • thanks, I use a template to show friends what I want is to do like facebook each time displaying more friends – saisneImane May 25 '12 at 05:09