Reputation: 69920
In a View
, I've created a <form>
that posts some data to another Controller
, which is different from that one that redirected me to the View. In this second controller, i perform some data validations and then, if errors are found, I need to redirect the user again to the source View but with the edited ModelState (so that i can show the validation errors).
Any tips?
Upvotes: 0
Views: 530
Reputation: 1038750
Instead of redirecting back to the original controller can't you just return View("~/Views/FirstController/Index.aspx")
? Another option would be to store the model inside TempData
before redirecting and fetching it back from TempData
in the first controller if available.
Upvotes: 3