0

Recently, i have shifted from ASP.NET web-forms to MVC based projects. I was thinking about the state management is working for a MVC project. How the MVC page controls are able to retain the state upon any action such as click, checked etc. I was wondering, if there is any DEFAULT state management pattern for the MVC app.

Please share some high level inputs.

2

ASP.NET/MVC doesn't try to hide the nature of the web (that is, it is stateless), like WebForms does.

This means it has no built-in way to manage state.

That's completely up to the developer.

  • I want to understand how the MVC page passes the data to the web-server. OR every web-request made on the page controls is a fresh request to the server. – Karan Dec 5 '16 at 10:40
  • I want to take a simple form example in MVC, where the user is trying to create new customers from the view with the help of the create button. – Karan Dec 5 '16 at 10:43
  • every request is a new request in both systems. MVC doesnt have the ViewState variable passed back and forth to mimic statefulness – Ewan Dec 5 '16 at 12:53
  • 1
    @Karan It is also very common to communicate with the server via ajax calls. There is no need to "maintain the state" of the web page on the server because the page doesn't get "unloaded" and "reloaded". The state of the page over time is maintained on the client via javascript. – Eric King Dec 5 '16 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.