title: ASP.NET MVC 3 Razor Syntax - Casting
body: <p>So, simple question really. :)</p>
  
  <p>I had this following code with <strong>ASPX View Engine</strong>:</p>
  
  <pre><code>&lt;strong&gt;&lt;%: ((City)Model.Location).Name %&gt;&lt;/strong&gt;
  </code></pre>
  
  <p>Which renders
  <strong>Los Angeles</strong></p>
  
  <p>If i do this with <strong>Razor View Engine:</strong></p>
  
  <pre><code>&lt;strong&gt;@((City)Model.Location).Name&lt;/strong&gt;
                               ^
                               |
  syntax highlighting stops here
  </code></pre>
  
  <p>It renders this:</p>
  
  <p><strong>(really huge object name must be .ToString).Name</strong></p>
  
  <p>So, the highlighting cuts off at <strong>Location)</strong>, and it's treating the <strong>.Name</strong> code i have (which is a property on a <strong>City</strong> object) as pure HTML.</p>
  
  <p>Why is it deeming the <strong>)</strong> as the end of the Razor code block?</p>
  
  <p>Any ideas?</p>
  
  <p>Also - is there a Razor reference which has all the syntax/keywords? (it took me a while to figure out that <code>&lt;% Import Namespace</code> is <code>@using</code> with Razor).</p>
  
  <p>Thanks Guys!</p>