I haven't found another question that answers this directly. I have an Ajax.BeginForm on my View like so
@using (Ajax.BeginForm("Action", "Controller", new AjaxOptions())){
//Stuff
<div id="aaaa"> @TempData["Key"] </div>
}
In the action method I set a value of a message in TempData that I want to output.
TempData["Key"] = "Value";
return View("View");
When I debug it, I see that it successfully adds the value to TempData. I also see that it still has the value when it starts rendering the View again. But for reasons I cannot explain, it just outputs as
<div id="aaaa"> </div>
Why doesn't it output the value when I know it has it?
Same goes for ViewData and ViewBag and Model properties