title: How to call and refresh a partial view in MVC 5 razor?
body: <p>How can a partial view on the create view that has to come in empty be refreshed with new data when a user selects a value from a list a values drop down?</p>
  
  <p>I have a tried a bunch of stuff listed on the message board as well as others and it just drills down to more errors. I just can't believe something so easy in webforms is this hard to do in MVC.</p>
  
  <p>I tried this both in Chrome and IE and get errors so I'm lost. I have something like this for a partial view in the shared folder:</p>
  
  <pre><code>&lt;table cellpadding="1" border="1"&gt;
      .... // table header
      @foreach (SYSTEMX.Models.VUE_ISSUE_LIST item in ViewBag.IssuesList)
      {
          &lt;tr&gt;
             &lt;td&gt;@item.Issue&lt;/td&gt;
         &lt;/tr&gt;
      }
  &lt;/table&gt;
  </code></pre>
  
  <p>The Create cshtml file has this:</p>
  
  <pre><code>&lt;div class="col-sm-6"&gt;
      &lt;div class="form-horizontal" style="display:none" id="PV_IssueList"&gt;
          @{ Html.RenderAction("UpdateIssuesList"); }
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In the Controller there is code similar to this</p>
  
  <pre><code>[HttpGet]
  public ActionResult UpdateIssuesList(int? VID)
  {
      ViewBag.IssuesList = GetIssuesList(VID);
      return PartialView("UpdateIssuesList");
  }
  </code></pre>
  
  <p>The GetIssuesList(VID) looks very similar to this and it is in the controller of the mvc application </p>
  
  <pre><code>private List&lt;VUE_ISSUE_LIST&gt; GetIssuesList(int? VID)
  {
      return db.VUE_ISSUE_LIST_.Where(i =&gt; i.ID == VID).ToList();
  }
  </code></pre>
  
  <p>I get this error. I'm clueless to what is going on here.</p>
  
  <blockquote>
    <p>The partial view 'UpdateIssuesList' was not found or no view engine supports the searched locations. The following locations were searched:
    ~/Views/CONTROLLERX/UpdateIssuesList.aspx<br>
    ~/Views/CONTROLLERX/UpdateIssuesList.ascx<br>
    ~/Views/Shared/UpdateIssuesList.aspx<br>
    ~/Views/Shared/UpdateIssuesList.ascx<br>
    ~/Views/CONTROLLERX/UpdateIssuesList.cshtml<br>
    ~/Views/CONTROLLERX/UpdateIssuesList.vbhtml<br>
       ~/Views/Shared/UpdateIssuesList.cshtml<br>
    ~/Views/Shared/UpdateIssuesList.vbhtml</p>
  </blockquote>
  
  <p>A forum user posted something like this as a solution and I guess it worked for him as he put a green check mark but it does not work for me at all:</p>
  
  <p><a href="https://stackoverflow.com/questions/18254749/updating-partialview-mvc-4">Updating PartialView mvc 4</a></p>
  
  <p>Also tried this:</p>
  
  <p><a href="https://stackoverflow.com/questions/33563916/refresh-a-partial-view-in-mvc">refresh a partial view in mvc</a></p>
  
  <p>Also read over this but it is so very technical that I don't follow it all that well. </p>
  
  <p><a href="https://www.simple-talk.com/dotnet/asp-net/tips-and-tricks-about-razor-partial-views/" rel="nofollow noreferrer">https://www.simple-talk.com/dotnet/asp-net/tips-and-tricks-about-razor-partial-views/</a></p>