title: Don't run javascript function in PartialView
body: <p>I add a js file in masterpage. and use it in View. </p>
  
  <pre><code>&lt;div class="control-group"&gt;
   @Html.LabelFor(model =&gt; model.Computers, new { @class = "control-label" })
   &lt;div id="computersEditorRows" style="clear: both; margin-right: 30px; padding: 10px; border: 1px solid rgb(204, 204, 204);"&gt;
     @foreach (var item in Model.Computers)
      {
        Html.RenderPartial("_ComputersEditorRow", item);
      }
  
    &lt;/div&gt;
    &lt;a id="addItemcomputer" style="cursor: pointer;"&gt;AddItem&lt;/a&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>and js file</p>
  
  <pre><code>$(document).ready(function () {
   $("#addItemcomputer").click(function () {
      $.get("/TechnicalOfficerService/AddComputerNewRow", function (data) {
          $("#computersEditorRows").append(data);
  
      }).fail(function (xhr, err) {
          alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
          alert("responseText: " + xhr.responseText);
      });
   });
  })
  </code></pre>
  
  <p>But when i use this in Partialview, don't call function. I use this html code in partial view, but don't call <code>$("#addItemcomputer").click</code>.</p>
  
  <p>Partial View</p>
  
  <pre><code>@model PSYCO.Web.Sepid.ViewModels.ComputerViewModel
  @using PSYCO.Web.Sepid.Helpers;
  &lt;div class="control-group"&gt;
  @using (Html.BeginCollectionItem("Computers"))
  {
     &lt;div class="control-group"&gt;
          @Html.LabelFor(model =&gt; model.Computers, new { @class = "control-label" })
          &lt;div id="computersEditorRows" style="clear: both; margin-right: 30px; padding: 10px; border: 1px solid rgb(204, 204, 204);"&gt;
              @foreach (var item in Model.Computers)
              {
                  Html.RenderPartial("_ComputersEditorRow", item);
              }
  
          &lt;/div&gt;
          &lt;a id="addItemcomputer" style="cursor: pointer;"&gt;Add Item&lt;/a&gt;
      &lt;/div&gt;
    &lt;a class="removeItemNationality" style="cursor: pointer;"&gt;Delete&lt;/a&gt;
     }
   &lt;/div&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Add this section in partial view.</p>
  
  <pre><code> @section Scripts
   {
    &lt;script&gt;
     $(document).on("click","#addItemcomputer",function () {
       alert('d');
       })
     &lt;/script&gt;
   }
  </code></pre>