title: Mix Razor and Javascript code
body: <p>I'm pretty confused with how to mix razor and js. This is the current function I am stuck with:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
          var data = [];
  
          @foreach (var r in Model.rows)
          {
                  data.push([ @r.UnixTime * 1000, @r.Value ]);
          }
  </code></pre>
  
  <p>If I could declare c# code with <code>&lt;c#&gt;&lt;/c#&gt;</code> and everything else was JS code -- this would be what I am after:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
          var data = [];
  
          &lt;c#&gt;@foreach (var r in Model.rows) {&lt;/c#&gt;
                  data.push([ &lt;c#&gt;@r.UnixTime&lt;/c#&gt; * 1000, &lt;c#&gt;@r.Value&lt;/c#&gt; ]);
          &lt;c#&gt;}&lt;/c#&gt;
  </code></pre>
  
  <p>What is the best method to achieve this?</p>