First off I am currently using MVC1. Basically sometimes my tempdata value is null after the first redirect even though I'm putting some values into it.
Basically here is my flow:
1. I'm inside my Index view
2. There is a URL.Action link inside that calls update status
3. UpdateStatus does some stuff, sets tempdata, then redirects back to the same view (this time with no parameters in the URL)
4. Problem is sometimes there is a value in tempdata and other times it is null. I cannot figure out under which circumstances it is null, it seems random to me (idNumber is never null as well).
public ActionResult Index()
model = querydatabase();
var a = TempData["success"];
public ActionResult UpdateStatus(int idNumber)
//update status here
TempData["success"] = "Successfully updated" + idNumber;
One other thing I've noticed also is that, once tempdata is null, if I keep clicking that same link after every redirect it stays at null even though the 'UpdateStatus' method is setting a value each time. If I refresh
View Complete Post