public ActionResult Index()
{
int retCode = Errors.SUCCESS;
var da = this.GetDataAccess();
var ids= new List<Models.Users>();
retCode = da.GetId(this.GetId(), ref ids, profiler);
return this.CheckIdForView(nRetCode, View(ids));
}
public ActionResult DeleteUser(string id)
{
var da = this.GetDataAccess();
var ids = new List<Models.Users>();
int retCode = Errors.SUCCESS;
retCode = da.DeleteId(this.GetId(), id);
return RedirectToAction("Index");
}
}
Obviously in the delete user action the retcode gets erased as soon as it redirects to the index action. I was wondering what the best practice for preserving a retcode like this is. I’ve seen a lot of talk about TempData, but is that the bestpractice?
You need to pass it in the querystring to an optional parameter in
index: