title: MVC Razor C# Variable used for HTML img tag src
body: <p>I have a lot of images I want to display so I'm using a dynamic partial view to reduce unnecessary code. This is my partial view:</p>
  
  <pre><code>@{ string[] imgs = { 
      "src='~/Content/images/1.png'", 
      "src='~/Content/images/2.png'", 
      "src='~/Content/images/3.png'" 
  };
  
  @foreach (var img in imgs) { *HTML GOES HERE* }
  </code></pre>
  
  <p>HTML inside foreach loop:</p>
  
  <pre><code>&lt;div class="thumbnail-border"&gt;
      &lt;img id="modalImage" class="thumbnail-lg" @Html.Raw(img) /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The strange thing is that if I switch out "src" for "alt", the alt works. But having a variable for src as the image path does not work. So my question is:
  If I wanted to use a foreach loop to go through an array of strings (the image paths) to use for my , how could I do that?</p>