It appears that I have been using asp.net databinding for so long I have forgotten some of the basics.
I am dynamically creating a table in an ASPX page without dat
I'd suggest a listview control. Something like this:
Imagename
Image
Location
Code behind :
protected void lvImages_ItemDataBound(object sender, ListViewItemEventArgs e) {
if (e.Item.ItemType == ListViewItemType.DataItem) {
ListViewDataItem currentItem = (ListViewDataItem)e.Item;
MyImageObject oImg = (MyImageObject)currentItem.DataItem;
Literal ltrCell1 = e.Item.FindControl("ltrCell1") as Literal;
ImageButton imgMyImage = e.Item.FindControl("imgMyImage") as ImageButton ;
Label lblLocation= e.Item.FindControl("lblLocation") as Label;
ltrCell1.text = string.format(@"{1} ", oImg.id, oImg.val);
imgMyImage.CommandArgument = oImg.arg;
imgMyImage.CommandName = "cmdNAme";
imgMyImage.ImageUrl = oImg.URL;
}
BEst of Luck!