2

After migrating to ASP.Net Core 3.0 my TempData is always null after redirecting to a View. Is there something wrong or missing at my startup.cs code?

1
  • 1
    Please don't add code as a comment. Edit your original question and add the code there Commented Dec 10, 2019 at 23:38

1 Answer 1

1

Try this part of code in startup.cs:

services.AddControllersWithViews().AddSessionStateTempDataProvider()
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! Works fine just with services.AddControllersWithViews().AddSessionStateTempDataProvider();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.