I have RedirectToAction as a return value in a controller and in my view I use ViewBag. While it’s a well-known problem that ViewBag becomes empty after a RedirectToAction. I have a problem when I reinitialize ViewBag values in my overloaded controller in the OnActionExecuting method. ViewBag is empty again.
But the problem is that on my local PC (win7) it’s working okay but on the web-hosting server (win 2008) it crashes. So can some one help saying what can cause that? Maybe it’s a setting or something?
I have RedirectToAction as a return value in a controller and in my view
Share
There was an exception deep inside data layer which was incorrectly captured and thereby prevented from propagation but caused ViewBag vanishing.
So be careful with exceptions catching.