bind a two-dimensional array to a repeater - error
- by Cristian Boariu
Hi,
I have this array:
string[,] productData = new string[5,7];
I bind it to a repeater and a call a method like:
<img src="<%# getPhoto1WithReplace(Container.ItemIndex) %>"
which is defined like:
public String getPhoto1WithReplace(Object itemIndex)
{
int intItemIndex = Int32.Parse(itemIndex.ToString());
if (productData[intItemIndex, 3] != null)
return this.ResolveUrl(productData[intItemIndex, 3].ToString());
else return String.Empty;
}
I do not understand why it calls getPhoto1WithReplace with itemIndex as 5.
My array has 5 indexes: 0,1,2,3,4, so HOW Container.ItemIndex can be 5...?