title: ASP.net MVC javascript in partial view is not running
body: <p>Maybe someone that can help me to understand what is the problem or error with this call to a partial view that has its own javascript code.</p>
  <p><strong>This is the main cshtml:</strong></p>
  <pre><code>@model  Ads_Negocio.FormTest
  
  @{
      ViewBag.Title = &quot;Reportone&quot;;
      Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;
  }
  &lt;div&gt; &lt;p&gt;Parent view&lt;/p&gt; &lt;/div&gt;
  &lt;p&gt;----------Partial view section-----------&lt;/p&gt;
  &lt;div&gt;
      &lt;p&gt;Partial view&lt;/p&gt;
      @Html.Partial(&quot;Componente/_aTestView&quot;)
  &lt;/div&gt;
  
  @section scripts{
      &lt;script type=&quot;text/javascript&quot;&gt;
          $(document).ready(function () {
              alert(&quot;parent view renderign&quot;)
          });
      &lt;/script&gt;
  }
  </code></pre>
  <p><strong>the partial view _aTestView.cshtml:</strong></p>
  <pre><code>&lt;button type=&quot;button&quot; id=&quot;btnGraficNew&quot;&gt;Run&lt;/button&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
      $(document).ready(function () {
          alert(&quot;partial view rendering&quot;);
          $(&quot;#btnGraficNew&quot;).click(&quot;click&quot;, function () {
              alert(&quot;Call from partial view&quot;);
          });
      });
  &lt;/script&gt;
  </code></pre>
  <p>Problems:</p>
  <ol>
  <li>After view is rendereng alert inside partial view is never call.</li>
  <li>When I press botton, it does not alert.</li>
  </ol>