I am trying to fill table with random color in each column(a rough idea to create an image in table form)(I may sound somewhat funny). I have created one view with code given below but is giving me OutOfMemoryException. Any kind of help will be appreciable. I am doing it in an MVC application.
<table>
@(int i=0;i<10;i++)
{
red = random.Next(0, 255);
green = random.Next(0, 255);
blue = random.Next(0, 255);
hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);
<tr style="height:1px !important; width:1px !important;background-color:'@hexColour'">
@{
for(int j=0;i<10;j++)
{
red = random.Next(0, 255);
green = random.Next(0, 255);
blue = random.Next(0, 255);
hexColour = String.Format("#{0:X2}{1:X2}{2:X2}", red, green, blue);
<td style="height:1px !important; width:1px !important;background-color:'@hexColour'"></td>
}
</tr>
}
}
</table>
Thanks in Advance