title: Javascript not working in Partial View
body: <p>This problem is similar to what is described in <a href="https://stackoverflow.com/questions/1447107/execute-javascript-inside-a-partial-view-in-asp-net-mvc">Execute Javascript inside a partial view in ASP.NET MVC</a></p>
  
  <p>The below piece of code in index.cshtml is working fine...</p>
  
  <hr>
  
  <pre><code>&lt;label for="locationOfSearch"&gt; in :&lt;/label&gt; @Html.TextBox("locationOfSearch")
  
  &lt;input type="submit" value="Search"  style="background-color:Green"/&gt;
  
  @section JavaScript {
      &lt;script type="text/javascript"&gt;
          $(document).ready(function () {
  
  
              $("#locationOfSearch").autocomplete({
                  source: '@Url.Action("AutocompleteAsyncLocations")'
              })
  
  
  
          });
      &lt;/script&gt;
  }
  </code></pre>
  
  <hr>
  
  <p>But when I copy and paste the above code and the respective script files to a another view and then in index.cshtml if I call Html.Partial(new view name), Autocomplete is not working...</p>
  
  <p>Kindly let me know how I solve it without much modification...</p>