[英]OutOfMemory exception for a table
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.
我使用下面给出的代码创建了一个视图,但是给了我OutOfMemoryException。 Any kind of help will be appreciable.
任何帮助都将是可贵的。 I am doing it in an MVC application.
我正在MVC应用程序中执行此操作。
<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 提前致谢
for(int j=0;i<10;j++)
应该:
for(int j=0;j<10;j++)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.