title: how to pass parameter to partial view in MVC4 razor
body: <p>In my asp.net mvc 4 application i want to pass a parameter to partial view,however the parameter we want to pass is coming from javascript code</p>
  
  <p>Below is the code</p>
  
  <pre><code>&lt;script&gt;
      var TestId;
  
   $(document).ready(function () {
  
          // Send an AJAX request       
  
  
          $.getJSON("/api//GetFun?Id="+@ViewBag.Id,
  
                  function (data) {
  
  TestId= data.Id
  //i am getting the id here which i need to pass in partial view
  
  }
  1)...........
  });
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>html code:</p>
  
  <pre><code> &lt;div id="tab1" &gt;
  
   2)....      @{ Html.RenderAction("MyPartialView", "MyController", new { id = TestId });}
    &lt;/div&gt;
  </code></pre>
  
  <p>So let me know how can i pass the test id to my partial view :in HTML(2) code or in javascript (1)</p>