0

I'm passing a value using TempData to an action result, when I build it locally, the value gets passed and is fine in the Thankyou action result.

However, when I publish this as an Azure ASP.NET Core web app, it fails - any values I pass as TempData are always empty/null.

Any ideas what I'm doing wrong here?

[HttpPost]
public IActionResult Index()
{
    // some code here
    TempData["activeId"] = activeId;
    return RedirectToAction("Thankyou");
}

public ActionResult Thankyou()
{
    object activeId;
    if (!TempData.TryGetValue("activeId", out activeId))
    {
        // This is true - it fails on Azure, but works locally
    }
    if (activeId == null)
    {
        // This is true - it null on Azure, but works locally
    }
    ViewBag.activeId = activeId;
    return View();
}

Ralpharama
  • 441
  • 4
  • 20

0 Answers0