title: Getting stuck with error: Model is not defined
body: <p>I have the following code in ASP MVC. Im trying to get the model as parameter for getting the right folder in js for playing music.</p>
  
  <pre><code>@foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Name)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Genre)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.ReleaseDate)
          &lt;/td&gt;
          &lt;td&gt;
              var model = @Html.Raw(Json.Encode(item.Mp3file));
              &lt;button onclick="getLocation(model)"&gt;Click me&lt;/button&gt; 
          &lt;/td&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
              @Html.ActionLink("Details", "Details", new { id=item.Id }) |
              @Html.ActionLink("Delete", "Delete", new { id=item.Id })
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p>When i click on 'Click me' I want JS does save the value in a var. So i created the var model where i store my location of my mp3file. When i click this the function getLocation(model) must be entered in the system. But it wont cover</p>
  
  <p>My function in JS</p>
  
  <pre><code>function getLocation(model) {
  var tekst = model;
  console.log(tekst);}
  </code></pre>
  
  <p>What am i doing wrong? </p>