 <p>You are already inside a code block; Razor does not parse within code blocks for other code blocks. The style part of the line should look something like this:</p> <pre><code>style = "width: 20px; background-color: " + Model.BackgroundColor + ";" </code></pre>