There is a form in the view that transfers data to the controller where it is written to the database. It is necessary to return to the Id representation of the inserted object. I do so return View("Index", model); Id data does not change. How to transfer a modified model to a view? Made through return Redirect("Index"); , but it looks like a sloppy: (

  • Write the code as an action that saves to the database and returns the view - Andrei S.

1 answer 1

Everything turned out to be very simple, ModelState.Clear(); clear the controller bindings.