title: MVC3 Razor and Javascript - lots of syntax errors in green
body: <p>I am starting to notice problems when I try and code my javascript and use functions that are in my viewmodel. Things like this:</p>
  
  <pre><code>    case 37:
          @if (Model.GoLeft)
          { 
  </code></pre>
  
  <p>Here I get a syntax error and the words "expected constant" for Model. Is there some solution to this? Do I need to upgrade something so it works?</p>
  
  <p>I checked around on stackoverflow. Someone else suggested that I should separate my js but that doesn't help me as for example in this case where I want the keypress to do something if on a certain type of page where the Model allows it. If the js is in another file I can't code this way.</p>
  
  <p>thanks</p>