How do I write out my array with a repeater?
string[,] month = { {"Januari", "Februari", "Mars", "Apri", "Maj", "Juni", "Juli", "Agusti", "September", "November", "Oktober", "December"},
{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}
};
Now I can use Container.DataItem, but how do I get the first string of items in one place and the second in another place?
<a href="Default.aspx?m=01">Januari</a>
It would be possible to use an array of arrays as data source (but not a two dimensional array), but you would have to arrange it the other way arround, so that each inner array would contain a name and a number.
I would prefer a more OOP approach though, it gives a bit more structure and the repeater code gets a lot cleaner:
Create a class for the month information:
Now you can create an array of objects to use as data source for the repeater:
In the repeater you use the properties of the month info class: