title: Conditional Compilation is Turned Off VS 2012 razor javascript
body: <p>I have searched SO and not found a solution to this problem. I have code like this: </p>
  
  <pre><code>&lt;script&gt;
  $("AddToFavorites").Click(function() {
      var apiLink = "/url/AddToFavorites?id=" + @Model.RecipeId;
      $.ajax({
          url: apiLink,
          type: "GET"
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>the . in Model.RecipeId gets underlined and I get a compiler error of: </p>
  
  <pre><code>Conditional compilation is turned off
  </code></pre>
  
  <p>Is it not possible to use c# code in a javscript block? If this is the case, how do I get around it to make the url dynamic in a case like this?</p>
  
  <p>Thanks.</p>