title: Accessing a local js variable in razor block
body: <p>I am trying to write razor code inside javascript where I am trying to use a local variable inside the razor code. Here is the sample code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  for (i = 0; i &lt; data.result.length; i++) {
       $("#member-table tbody").append("&lt;tr&gt;");
  
       var id = data.result[i].MemberId;
  
       var actions = $("&lt;td&gt;" + @Html.ActionLink("Detay", "Edit", new { id })  + "&lt;/td&gt;)");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>the problem is that <code>id</code> is not recognized by the razor code (i.e. it does not exist in the current context). How can I achieve that ? Is there any way ?</p>