title: How to Load Partial Views with Jquery UI Tab by passing parameters?
body: <p>I have a parent page (<strong>DistributionReview.aspx</strong>) that has a <strong>Deposit Date</strong> to select using DatePicker.</p>
  
  <p>Just below I have <strong>two tabs</strong>(*<em>DistributionByType</em>* and <strong>DistibutionByStatus</strong>) that I want to load PartialViews. <strong><em>Here the parameter to the PartialView is DepositDate</em></strong>.</p>
  
  <p>And I have a custom ViewModel called <strong>DistributionReviewModel</strong> that the parent page is implementing.</p>
  
  <p>I am coming across articles that are directly loading static partial views(Ex: 
  <a href="http://www.kevgriffin.com/blog/index.php/2010/02/23/using-jquery-tabs-and-asp-net-mvc-partial-views-for-ajax-goodness/" rel="nofollow">http://www.kevgriffin.com/blog/index.php/2010/02/23/using-jquery-tabs-and-asp-net-mvc-partial-views-for-ajax-goodness/</a>
   ). But I am looking for any code sample/articles by passing parameter?</p>
  
  <p>Appreciate if anyone can share code samples to pass parameters and <strong>load the partialview both when the TabSelection is changed and and DepositDate is changed</strong>.</p>
  
  <p>Thanks for your time.</p>
  
  <p><strong>Html Code:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(function () {
      //tab
      $("#divDistributionReview").tabs();
  
      $("#fileDepositDate").datepicker(); //DateTime Picker
      var depositDate = $("#fileDepositDate").val();
  
  });
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div id="container" &gt;
  
  &lt;% using (Html.BeginForm("frmDistributionReview", "DistibutionReview"))
  { %&gt;
  
      &lt;div&gt; Select a Date: &amp;nbsp;     &lt;input type="text" id="fileDepositDate" name="datepicker"  value='&lt;%= ViewData["FileDepositDate"] %&gt;' /&gt;&lt;/div&gt;     
      &lt;div id="divDistributionReview"&gt;             
      &lt;ul&gt;                 
      &lt;li&gt;&lt;a href="/DistributionReview/DistributionByType"&gt;Distribution Type&lt;/a&gt;&lt;/li&gt;                 
      &lt;li&gt;&lt;a href="/DistributionReview/DistributionByStatus"&gt;Status&lt;/a&gt;&lt;/li&gt;             
      &lt;/ul&gt;     
      &lt;/div&gt; 
          &lt;%} %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>C# Code:</strong></p>
  
  <pre><code>public ActionResult DistributionReview()
      {
          ViewData["FileDepositDate"] = DateTime.Now.ToShortDateString();
          var view = View(ApplicationConstants.DistributionReviewViewName, new MegaLockbox.Web.ViewModels.DistributionByTypeViewModel(securityManager, distributionReviewDataAdapter, Convert.ToDateTime(ViewData["FileDepositDate"])));
          return view;
      }
  
  
      public ActionResult DistributionByType(string id)
      {
          DateTime depositDate;
          var view = new PartialViewResult();
          if (DateTime.TryParse(id , out depositDate))
          {
              view = PartialView(ApplicationConstants.DistributionByTypeViewName, new MegaLockbox.Web.ViewModels.DistributionByTypeViewModel(securityManager, distributionReviewDataAdapter, depositDate));
          }
          return view;
      }
  
      public ActionResult DistributionByStatus(string id)
      {
          DateTime depositDate;
          var view = new PartialViewResult();
          if(DateTime.TryParse(id, out depositDate) )
          {
              view = PartialView(ApplicationConstants.DistributionByStatusViewName, new MegaLockbox.Web.ViewModels.DistributionByTypeViewModel(securityManager, distributionReviewDataAdapter, depositDate));
          }
          return view;
      }
  </code></pre>