I have a View in MVC called Action, which accepts and ID as parameter. I also have another view called Action, but it is marked as HTTPPOST.
The POST version of Action can fail programatically. When it fails, I want to add a ModelError, and then Redirect to the GET version of Action, whilst I provide the ID .
In short => I want to transfer to a GET view from a POST view, and pass parameters. Something along the lines of
ModelState.AddModelError("", "Could not verify token");
return RedirectToAction("Action", "ExpiredAccounts" new { aid = myId });
Where Action is the View, ExpiredAccounts is the Controller and AID is the Account ID. This of course does not work since you can add a model error to a view, not redirecting
Thanks