title: Visual Studio confused by server code inside javascript
body: <p>I ran into an annoying problem: the following code gives a warning in Visual Studio.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var x = &lt;%: ViewData["param"] %&gt;;
  &lt;/script&gt;
  </code></pre>
  
  <p>The warning is "Expected expression". Visual Studio gets confused, and all the javascript code after that is giving tons of warnings. Granted, it's all warnings, and it works perfectly fine in runtime - but it is very easy to miss real warnings among dozen of false positives.</p>
  
  <p>It was working the same way in VS2008, and it wasn't fixed in VS2010. Does anybody know if there is a workaround, or a patch?</p>