Hello. People, please tell me such a thing. For example, in WebForms, a certain label block has text that was entered in some textbox. Further, when sending back / responding, this text is returned to the same label block due to the presentation state. But how to do this in MVC, because there are no view states in the same place? But I understand that there must be some analogue of viewstay, what is it ??

  • there is no ViewState in MVC - use <input type = "hidden" ... - Igor
  • How about saving data to Session? - user209028

2 answers 2

Yes, there is no state saving in MVC, and it is not necessary. If you want to transfer any data, use:

  1. Form submission
  2. Saving in cookies
  3. Passing Parameters in Browser Row
  • Thanks for the answer. Although it seems to me that in vain they removed the preservation of states. Thanks to him, there were pseudo-events, it really helped. - Polyakov Sergey
  • This “state saving” is the add-on for cookies (or sending forms, I don't remember exactly), the only difference is less flexibility. - gromanev

I will also add to the previous answer, as an option you can also save to localstorage and which more important data is in session