I am dynamically creating a table which will display an image in the background and a semi-transparent color over areas that are relevant to the image. I need to evaluate DB content against counters inside my code so as to be able to insert hyperlinks and images only on areas that are affected.
Here is a sample of my code.
protected void Button1_Click(object sender, EventArgs e)
{
int rowCount;
int cellCount;
int j = 0;
int i = 0;
for (rowCount = 0; rowCount < 3; rowCount++)
{
j++;
TableRow r = new TableRow();
for (cellCount = 0; cellCount < 3; cellCount++)
{
i++;
TableCell c = new TableCell();
c.Controls.Add(new LiteralControl("<a href='default.aspx' target='_blank'><img src='images/active-sm.png' alt='' style='border:0;' /></a>"));
r.Cells.Add(c);
}
Table1.Rows.Add(r);
}
} The conditional processing would occur when using the LiteralControl. I need to evaluate and insert table data.