Saturday, 26 September 2015

ASP .NET STATE MANAGEMENT

ASP .NET STATE MANAGEMENT

INTRODUCTION

State management is the process by which you maintain state and page information over multiple requests for the same or different pages. 





















TYPES OF STATE MANAGEMENT

- Client-side state management
- Server-side state management 

CLIENT SIDE STATE MANAGEMENT

ASP.NET provides several techniques for storing state information on the client. 
This maintains information on the client's machine using Cookies, View State, and Query Strings.

1-View State :-Each page and each control on the page has View State property. This property allows automatic retention of page and controls state between each trip to server. This means control value is maintained between page postbacks. View state is implemented using _VIEW STATE, a hidden form field which gets created automatically on each page. You can't transmit data to other page using view state.

2-Query String :-Query string can maintain limited state information. Data can be passed from one page to another with the URL but you can send limited size of data with the URL. Most browsers allow a limit of 255 characters on URL length.


3-Hidden Field :-Hidden field is a control provided by ASP.NET which is used to store small amounts of data on the client. It store one value for the variable and it is a preferable way when a variable's value is changed frequently. Hidden field control is not rendered to the client (browser) and it is invisible on the browser. A hidden field travels with every request like a standard control’s value.

4-Cookies  :-Cookies are small piece of information that server creates on the browser. Cookies store a value in the user’s browser that the browser sends with every page request to the web server. 

SERVER SIDE STATE MANAGEMENT

1-Application :-The data stored in an application object can be shared by all the sessions of the application. The application object stores data in the key value pair. This object stores the data that is accessible to all pages in a given Web application. The Application object contains global variables for your ASP.NET application. 

2-Session :-Session object stores user-specific data between individual requests. This object is same as application object but it stores the data about particular user. ASP.NET creates unique session-Id for each session of the application. Session-IDs are maintained either by an HTTP cookie or a modified URL, as set in the application's configuration settings. By default, Session-ID values are stored in a cookie. 

3-Cache :-Caching is the process of storing data that is used frequently by the user. Caching increases your application’s performance, scalability, and availability. You can catch the data on the server or client. 

4-Profile :-Profile data is stored in the SQL Server database by default.









1 comment:

  1. Hi I read your whole blog. This is very nice. Good to know about the career in testing is broad and is very demanding in future. We are also providing various Microsoft .Net anyone interested can Microsoft .Net Training for making their career in this field .

    ReplyDelete

Factorial of a Number

Recently Viewed