title: How to display C# code as simple text in the MVC view?
body: <p>I have MVC website, and I would like to show some code snippets as text on my website. Something like this:</p>
  
  <pre><code>List&lt;ImageInfoModel&gt; imgList = new List&lt;ImageInfoModel&gt;();
  string imgPath = @"~/Content/Images/ImageGallery/";
  string tmbPath = @"~/Content/Images/ImageGallery/thumbnails/";
  
  string imgFullPath = Server.MapPath(imgPath);
  string tmbFullPath = Server.MapPath(tmbPath);
  </code></pre>
  
  <p>If I simply copy and paste this into my view with <p> code text <p> it messes things up because of @ symbol.</p>
  
  <p>So my question is: How can I display C# code inside my view?</p>
  
  <p>Thanks in advance.  </p>