1

User State Object sets its value in session that's way we can get value from any where but model state object which is nothing more then a Jobject which doesn't use session to store value then how model state variable remain it's value when we come back later

1

The Model is not intended to save anything (I am not talking about model cache), because that is a job for session. That is why model very often uses User State to retrieve some data form the session, for example the states of different filters.

  • that means model state variables will be lost as soon as we navigate to different view ( that using other model) .? but if we want to save values for cross view we Have to use user State Variable.? and yes Thanks – SUMER CHOUHAN Feb 16 '15 at 6:50
  • Yes you need to use a User State to save the values across different views. – Dmitry Rekun Feb 16 '15 at 9:13

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.