0

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

1 Answer 1

3
for(int j=0;i<10;j++)

should be:

for(int j=0;j<10;j++)
Sign up to request clarification or add additional context in comments.

1 Comment

Ohh man, I shoud have noticed that. anyway thank you very much. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.