title: Get Json from Web api and pass to partial view from controller
body: <p>At the moment I have this as my code:</p>
  
  <pre><code> public ActionResult Search(SearchModel model)
      {
          string url = "http://10.0.2.31/testwebapi/api/data";
          WebClient wc = new WebClient();
  
          wc.QueryString.Add("forename", model.Forename);
          wc.QueryString.Add("surname", model.Surname);
          wc.QueryString.Add("caseid", model.CaseId);
          wc.QueryString.Add("postcode", model.Postcode);
          wc.QueryString.Add("telephone", model.Telephone);
          wc.QueryString.Add("email", model.Email);
          wc.QueryString.Add("title", model.Title);
  
          var data = wc.UploadValues(url, "POST", wc.QueryString);
  
  
          var responseString = Encoding.Default.GetString(data);
  
          return PartialView("~/Views/Shared/SearchResults.cshtml", responseString);
  
      }
  
      public class RootObject
      {
          public int Caseid { get; set; }
          public string Title { get; set; }
          public string Forename { get; set; }
          public string Surname { get; set; }
          public string Postcode { get; set; }
          public string Telephone { get; set; }
          public string Email { get; set; }
          public string DOB { get; set; }
          public string Mobile { get; set; }
          public string MaritalStatus { get; set; }
          public string LoanPurpose { get; set; }
          public bool CourtesyCall { get; set; }
          public string isOpen { get; set; }
      }
  </code></pre>
  
  <p>im not sure where i am going wrong i want it to be able to pull that data from the web api (which returns a json file). then what i want to do is send that data through to my partialview where a <code>@foreach</code> statement will put it into a table but i cant seem to get it to send the data it is interperating it as a string and i dont know why</p>
  
  <p>this is how it is returning:</p>
  
  <p><a href="https://i.stack.imgur.com/w5ghx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w5ghx.png" alt="enter image description here"></a></p>
  
  <pre><code>@model  string
  @{ 
      Layout = null;
  }
  
  @foreach(var Case in Model)
  {
      &lt;p&gt;@Case&lt;/p&gt;
  }
  </code></pre>
  
  <p>Partial view code.</p>
  
  <p>This is what my partial now looks like:</p>
  
  <pre><code>@model  IEnumerable&lt;Savvy_CRM_MVC.Models.RootObject&gt;
  @{ 
      Layout = null;
  }
  @foreach (var m in Model)
  {
      &lt;p&gt;@m&lt;/p&gt;
  }
  </code></pre>
  
  <p>which when i run through the for each is gives me this Savvy_CRM_MVC.Models.RootObject</p>