Friday, 28 June 2013

Insight State management


softMind IT Tutorial: Maintaining Session in MVC

In ASP.net we used following state management tricks. Ofcourse not all but of the tricks we can still use in MVC build  applications.

Client-Based State Management Options
  • View State -- NOT IN MVC
  • Control State -- NOT IN MVC
  • Hidden Fields
  • Cookies
  • Query Strings
Server-Based State Management Options
  • Application State
  • Profile Properties
  • Session State

Levels of state management :

  1. Single or multiple page level: State management at single as well as multiple page level i.e., managing state between page requests.
  2. User level: State should be preserved as long as a user is running the application.
  3. Application level: State available for complete application irrespective of the user, i.e., should be available to all users.
  4. Application to application level: State management between or among two or more applications

Session is maintained  in MVC using :
  1. Tempdata
  2. viewdata
  3. viewbag

No comments:

Post a Comment