title: How to set javascript variables using MVC4 with Razor
body: <p>Can someone format the code below so that I can set srcript variables with c# code using razor?</p>
  
  <p>The below does not work, i've got it that way to make is easy for someone to help.</p>
  
  <pre><code>@{int proID = 123; int nonProID = 456;}
  
  &lt;script type="text/javascript"&gt;
      @{
  
       &lt;text&gt;  
  
      var nonID =@nonProID;
      var proID= @proID;
      window.nonID = @nonProID;
      window.proID=@proID;
  
      &lt;/text&gt;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I am getting a design time error</p>
  
  <p><img src="https://i.stack.imgur.com/ptrsT.png" alt="enter image description here"></p>