Tuesday, November 24, 2009

Automatic Thumbnail C#

HtmlTable dTable = new HtmlTable();
dTable.Width = "500px";
dTable.CellPadding = 2;
dTable.CellSpacing = 0;
dTable.Border = 0;

int col = 5;

HtmlTableRow dTRow = new HtmlTableRow();
for (int count = 0; count < tmp.Length; count++)
{
if ((count % col == 0) && (count != 0))
{
dTable.Controls.Add(dTRow);
dTRow = new HtmlTableRow();
}
HtmlTableCell dTCell = new HtmlTableCell();
Photo result = tmp[count];
dTCell.InnerHtml = "

";
dTRow.Controls.Add(dTCell);
}

dTable.Controls.Add(dTRow);
Panel1.Controls.Add(dTable);

No comments: