title: How to end code inside a string?
body: <p>I know this is basic, but I'm feeling there's got to be a better way to do this.</p>
  
  <p>I have a dynamic file name:</p>
  
  <pre><code>/img/car-1.jpg
  /img/car-2.jpg
  /img/car-3.jpg
  </code></pre>
  
  <p>In my Model View, I want to do this:</p>
  
  <pre><code>&lt;img src="/img/car-@Model.Number.jpg" /&gt;
  </code></pre>
  
  <p>Unfortunately the compiler considers the <code>.jpg</code> to be part of the code, and says <code>'int' does not contain a definition for jpg</code>.</p>
  
  <p>I also tried this:</p>
  
  <pre><code>&lt;img src="/img/car-@{Model.Number}.jpg" /&gt;
  </code></pre>
  
  <p>But it gives me this error: <code>'System.Web.Mvc.WebViewPafe&lt;TModel&gt;.Model' is a 'property' but is used like a 'type'</code>.</p>
  
  <p>So for now I use a string builder at the top of the page, but it seems so verbose for such a simple issue. How can I tell C# "I'm done with this <code>@</code> code section?"</p>
  
  <p>Edit: a suggestion said my question was like <a href="https://stackoverflow.com/questions/8776641/c-sharp-razor-syntax-inside-a-string">this one</a>, so here's how it's different: I am using the solution to that question in my code example, and still getting an error.</p>