Successfully reported this slideshow.

State Management In ASP.NET And ASP.NET MVC

21,048 views

Published on

As we all know HTML is stateless language. It cannot persist state, so every web development framework provides facility to maintain state in one way or another way. There are different techniques available for state management in ASP.NET and ASP.NET MVC. Following is summary of all such techniques for maintaining state.

Published in: Technology
  • Great list. We are inviting Java Developers like you to help the other developers on http://www.gofaqs.com and get paid $ 1.00 per answer
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ok
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

State Management In ASP.NET And ASP.NET MVC

  1. 1. Articles from Jinal Desai .NETState Management in ASP.NET and ASP.NET MVC2013-03-15 17:03:17 Jinal DesaiAs we all know HTML is stateless language. It cannot persist state, so every webdevelopment framework provides facility to maintain state in one way or anotherway. There are different techniques available for state management in ASP.NET andASP.NET MVC. Following is summary of all such techniques for maintaining state.Client Based State Management Options The ViewState property provides a dictionary object for retainingView State values between multiple requests for the same page. The ControlState property allows you to persist property informationControl that is specific to a control and cannot be turned off like the ViewStateState property.Hidden A HiddenField control stores a single variable in its Value property andFields must be explicitly added to the page. A cookie is a small amount of data that is stored either in a text file onCookies the client file system or in-memory in the client browser session.Query A query string is information that is appended to the end of a pageString URL.View ViewData is a dictionary of objects accessible using strings as keys.Data(MVC)View ViewBag is a dynamic property. It does not require typecasting forBag(MVC) complex objects. TempData is a dictionary of string key and object value. TempDataTemp keep the information for the time of an HTTP Request. This mean onlyData(MVC) from one page to another.Server Based State Management OptionsApplication Application state is a global storage mechanism that is accessibleState from all pages in the Web application.Session Session state is similar to application state, except that it is scoped toState the current browser session. Profile Properties is similar to Session State. The profile-propertiesProfile feature uses an ASP.NET profile, which is stored in a persistent formatProperties and associated with an individual user.

×