I have an element in a cshtml view and come code that generates a random color. No matter what I try I can't make it work. Using the @ symbol at all removes the highlighting of the color property (I assume this is an indicator that it's not going to work)
@using(//using code for accessing database)
{
//code to make query
Random rnd = new Random();
Color randomColor = Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256));
//other code
//displaying information
<p style="color: @randomColor">@db.item</p>
}