title: Passing data from partial view to parent view
body: <p>I am trying to pass a value from partial view to parent view. I tried the below which didn't worked for me. Can some one help me out how can I achieve this? By using the value that partial view returned, I am trying to hide a button which is in the parent view.</p>
  
  <p>Parent View:</p>
  
  <pre><code>    &lt;div id="ProductCount"&gt;
      @{
          Html.RenderAction("ProductPartialView", "ProductList", new { area = "PR", ProductID = Model.ProductID, allowSelect = true});
      }
  
  &lt;div class="saveBtnArea"&gt;
      &lt;input type="submit" value="Submit App" id="btn-submit" /&gt;
  &lt;/div&gt;
  
      jQuery(document).ready(function () {
              var ProductCount = jQuery("#ProductCount").val();
  
              if (ProductCount == 0) {
                  jQuery("#btn-submit").hide();
              }
              else {
                  jQuery("#btn-submit").show();
              }
          });
  </code></pre>
  
  <p>Partial View:</p>
  
  <pre><code>&lt;fieldset&gt;
  &lt;div&gt;
  &lt;input type="hidden" id="ProductCount" value="5" /&gt;
  &lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>