F
flyAway
HI
In my first asp.Net Homepage I have the following problem:
There are some ImageButtons, witch ImageURL constantly changes. Now I would
like to create an array, so that I can assign the ImageURLs in a loop.
HTML:
<TR>
<TD><asp:imagebutton id="ImgBtn_1_1" runat="server"
ImageUrl="Image_001_001.jpg"></asp:imagebutton></TD>
<TD><asp:imagebutton id="ImgBtn_2_1" runat="server"
ImageUrl="Image_002_001.jpg"></asp:imagebutton></TD>
....
</TR>
<TR>
<TD><asp:imagebutton id="ImgBtn_1_2" runat="server"
ImageUrl="Image_001_002.jpg"></asp:imagebutton></TD>
<TD><asp:imagebutton id="ImgBtn_2_2" runat="server"
ImageUrl="Image_002_002.jpg"></asp:imagebutton></TD>
....
</TR>
....
ASP.Net:
// Create Array
int iColumns = 10;
int iRows = 5;
ImageButton[,] ImgBtn = new ImageButton[iColumns,iRows];
for(int y = 1; y <= iRows + 1; y++)
{
for(int x = 1; x <= iColumns + 1; x++)
{
ImgBtn[x,y] = "ImgBtn_x_y" ; // What to write instead of "ImgBtn_x_y"
?
}
}
....
Any idea?
Thanks
In my first asp.Net Homepage I have the following problem:
There are some ImageButtons, witch ImageURL constantly changes. Now I would
like to create an array, so that I can assign the ImageURLs in a loop.
HTML:
<TR>
<TD><asp:imagebutton id="ImgBtn_1_1" runat="server"
ImageUrl="Image_001_001.jpg"></asp:imagebutton></TD>
<TD><asp:imagebutton id="ImgBtn_2_1" runat="server"
ImageUrl="Image_002_001.jpg"></asp:imagebutton></TD>
....
</TR>
<TR>
<TD><asp:imagebutton id="ImgBtn_1_2" runat="server"
ImageUrl="Image_001_002.jpg"></asp:imagebutton></TD>
<TD><asp:imagebutton id="ImgBtn_2_2" runat="server"
ImageUrl="Image_002_002.jpg"></asp:imagebutton></TD>
....
</TR>
....
ASP.Net:
// Create Array
int iColumns = 10;
int iRows = 5;
ImageButton[,] ImgBtn = new ImageButton[iColumns,iRows];
for(int y = 1; y <= iRows + 1; y++)
{
for(int x = 1; x <= iColumns + 1; x++)
{
ImgBtn[x,y] = "ImgBtn_x_y" ; // What to write instead of "ImgBtn_x_y"
?
}
}
....
Any idea?
Thanks