This should have been fairly obvious, but we cannot expect the ViewBag to persist since a RedirectToAction only serves the client with a 302 redirected HTTP response to the new route. A solution for this is to use “TempData[“key”]”, this is a dictionary that is persisted in the users session meaning that we can retrieve it in the new action or controller or wherever the recieving end is.
- Microsoft exam AZ-900 vs AZ-204, which one is right for me?
- Generate Swagger file to disk with Swashbuckle in DevOps
- Structured logging with Durable Functions and Application Insights
- Easy github pages index.html
- Define security schemas for Swagger UI to try out authenticated endpoints
- Secure your Swagger endpoints using basic authentication