Getting users friends profile images

Jan 25, 2012 at 7:57 AM

I am trying to create a friend selector

I have managed to get a list of friends and bind it to a gridview.


Dim userfriends = GraphApi.User.GetFriends(user.ID, Api.AccessToken, 0, 0)

Me.GridView1.DataSource = userfriends

Is there a way of getting their profile images as well


Jan 25, 2012 at 4:13 PM

I have sort of solved this by using 

  <asp:Image ID="Image1" CssClass="thumb" runat="server" ImageUrl ='<%# "" & Eval("ID") & "/picture?type=large %> ' />

after my gridview is databound. However I am not sure this is the best way as it has to request over 300 times if the user has 300 friends

Jan 27, 2012 at 10:42 AM

This is the only way. You may use thumbnails instead of using large versions of the images if there are a lot of friends.