private void PopulatePhotos(MySpace myspaceClient, int userId) { var photos = (UserPhotos)JsonConvert.Import(typeof(UserPhotos), myspaceClient.GetAllPhotos(userId)); if (photos.Count > 0) { StringBuilder sb = new StringBuilder(); sb.Append("<table>"); int i = 0; foreach (var photo in photos.Photos) { if (i % 3 == 0) { sb.Append("<tr>"); } sb.Append(string.Format("<td><img src='{0}' </td></td>", photo.SmallImageUri)); if (i % 3 == 0) { sb.Append("</tr>"); } i++; } sb.Append("</table>"); divPhotos.InnerHtml = sb.ToString(); } }
private void PopulatePhotos(MySpace myspaceClient, int userId) { var photos = (UserPhotos)JsonConvert.Import(typeof(UserPhotos), myspaceClient.GetAllPhotos(userId)); if (photos.Count > 0) { divPhotos.InnerHtml = "<ul>"; foreach (var photo in photos.Photos) { divPhotos.InnerHtml += string.Format("<li><img src='{0}' </></li>", photo.SmallImageUri); } divPhotos.InnerHtml += "</ul>"; } }