Saturday, 1 October 2016

State Management in Asp.Net

  • Web Applications are purely stateless application because every request is identify and takes as new request in order to manage our programs as state full programs. We use many Asp.net Objects or Concepts and provide stateless programs to state full programs
  • Initially this Concept came from Amazon.com
  • Today every Web Application Demands High Level Environment t to our User. As a developer it is very important to understand different levels of state management techniques
  • The following are the List of Asp.Net Options to provide State Management .This List are divided into two parts

                                   1.Client SideState Management
                                   2.ServerSide State Management

·  ClientSide State Management                                                                                             
  •  When we use resource of client for managing the state Related Activities  then it is called “Client Side State Management”.   
  •  Client Side Resource means the memory of client, Storage of Client or anything that travels    between Request and Response.    
  •  Client Side State Management Techniques are   

                                                                   1) View State
                                                                   2) Cookies
                                                                   3) Query String
                                                                   4) Hidden Field
                                                                   5) Post Back      

                                                                                                                          ServerSide State Management       

  • When we use resource of Server Side for managing the state Related Activities then it is called “Server Side State Management”.                                                    
  • Server Side Resource means will not travel travels between Request and Response 
  • Server Side State Management Techniques are
                                1) Application State
                                2) Session State
                                                        In-Proc
                                                        State Server
                                                        SQL Server

1) View State

  • One of the good features in Asp.net Web forms is View State
  • Using this we can implement state management for Web Forms
  • View State is the concept of Collection Property
  • View State is for page means, it provides a state for Controls of the Page and For Variables Objects of the PagE
  • For controls it will manage state implicitly that means, we need not write any logic to perform state management for controls. 
  • We have two properties     1)Enable View State   2) View State Mode
  • Using this we can control the state of our form and its child controls enable View state of our form and its properties and dependent on its parent control with view state we can manage the state more effectively.
  • For Variable we have to provide state (Explicitly) and for that also asp.net provide View State property which means the same View State Concept but with Explicit implementation Combine for single page using View State We can Provide Rich State full Out Put

                                                   

2) Cookies

  • Cookie is the concept of Http.
  • Which means all web based application can be used this concept in same method.
  • Cookie is a small piece of information just like a variable, which has the ability to travel  between request and response  implicitlY.
  • Cookie can store  only primitive types of datA.
  • It can’t store complex type of data.
  • Cookies are managed and maintain by browser.
  • Browser allows only 20 cookies per Domain.
  • And Size of this cookie should not exceed 4KB.







No comments:

Post a Comment