title: ASP.Net MVC ActionResult returns cached View?
body: <p>After asking several questions on how to refresh a page depending on a selected value of a dropdown control I now have a new question - Somehow my "ChangeLanguage" Method returns a cached version of my View.</p>
  
  <p>View:</p>
  
  <pre><code>@model ViewModels.HomeViewModel
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta name="viewport" content="width=device-width" /&gt;
  &lt;script src="~/Scripts/jquery-1.10.2.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;title id="Title"&gt;Default&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="Header"&gt;
      &lt;div class="HeaderTextArea"&gt;
          &lt;span id="HeaderText"&gt;
              @Model.Title.Where(o =&gt; o.Language.Equals(Model.SelectedLanguage)).FirstOrDefault().ControlText
          &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="HeaderImageArea"&gt;
          &lt;img id="RB_Image" src="~/Content/Images/RB_Logo.png" alt="RB_IMAGE" /&gt;
      &lt;/div&gt;
      &lt;div class="LanguageSelection"&gt;
          @{
              @Html.DropDownList("SelectedLanguage", new SelectList(Model.AvailableLanguages, "ID", "Description"))
          }
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="Content"&gt;
      @RenderBody()
  &lt;/div&gt;
  </code></pre>
  
  <p>
  </p>
  
  <pre><code>&lt;script&gt;
  var url = '@Url.Action("ChangeLanguage", "Home")';
  $('#SelectedLanguage').change(function () {
      $.getJSON(url, {
          ID: $(this).val(), Model: @Html.Raw(Json.Encode(Model))
          });
  });
  </code></pre>
  
  <p></p>
  
  <p>Note that this is my Layout-View. I also tried this on my Index with the same result.</p>
  
  <p>Controller:</p>
  
  <pre><code>public class HomeController : Controller
  {
      public ViewModels.HomeViewModel HVM { get; private set; }
      // GET: Home
      public ActionResult Index()
      {
          this.HVM = new ViewModels.HomeViewModel();
          this.HVM.SelectedLanguage = this.HVM.AvailableLanguages.First();
          return View(this.HVM);
      }
  
      public ActionResult ChangeLanguage(int id, ViewModels.HomeViewModel model) {
          model.SelectedLanguage = model.AvailableLanguages.Where(o =&gt; o.ID.Equals(id)).First();
          model.SelectedTitle = model.Title.Where(o =&gt; o.Language.Equals(model.SelectedLanguage)).First();
          return View("Index", model);
      }
  }
  </code></pre>
  
  <p>The ChangeLanguage Method gets called, modifies the required data and returns a "new" View as expected - the logic inside the View does it's job, too - but the expected content does not show up - instead the data from the "first View" shows up. So the data and the displayed data differs.</p>
  
  <p>Ps. I know that Views should be dumb and no logic should be placed inside - but this is just for test purpose. At the end everything should be located inside my ViewModels.</p>