title: How To Change or refresh data using ViewBag in MVC3
body: <p>I want to refresh the data in the view using ViewBag. Is it possible or may i use some other technique.... </p>
  
  <p>Here is my sample Code </p>
  
  <p><strong>In My View Page</strong> ( <strong><em>FamilyDetails</em></strong>)</p>
  
  <p><code>@ViewBag.Details[0].Name</code></p>
  
  <p><strong>In My Controller</strong> </p>
  
  <pre><code>public ActionResult FamilyDetails(string StrText)
      {
          if (StrText != null)
          {
              ViewBag.MarriageDetails = ListMarriages;
          }
          else
              ViewBag.MarriageDetails = ListMarriages1;
  </code></pre>
  
  <p>Please explain with code.</p>
  
  <p>Thanks in advance</p>