Use model variable names dynamically in Razor C#
<p>I have a model in which there are four variables, namely:
<code>Image1</code>, <code>Image2</code>, <code>Image3</code> and <code>Image4</code></p>

<p>I am trying to put four <code>&lt;img&gt;</code> elements in the view using a for loop. The <code>src</code> attribute of these elements should be <code>src = "\Images\@Model.Image1"</code>, <code>src = "\Images\@Model.Image2"</code> and so on.</p>

<p>So, is there a way to do this inside the for loop ?</p>

<p>What I've now:</p>

<pre><code>@for (int i = 1; i &lt;= 4; i++)
{
    &lt;img src="\Images\@Model.ImagePath1" id="image@(i)" width="150px" height="100px" /&gt;
}
</code></pre>

<p>Thanks :)</p>