Chapter 14. State Management

Simply put — building ASP.NET applications is more difficult than other types of applications, such as building a Windows Forms application, mainly because Web applications are a stateless type of application.

The Internet is stateless by nature. You are simply making requests and responses (generally over HTTP). The server receives an HTTP request for a particular page and sends the caller the requested page (the response). The server that is sending the response does not keep track of who made the request. Every request is equal in the server's eyes.

When the same calling application makes a second request, the server gives it the second piece of information but still does not house any information about this calling application. The server does not know that this application is the same one that just recently requested the first piece of logic.

This creates a problem if you want your Web application to remember information about the calling application. Remembering the calling application and being able to make a distinction between requests allows end users to work through an application in a continuous manner. You may want your application to retain certain information: who the users are, their preferences, or any other pertinent information about them as they makes multiple requests. You do this by using varying techniques that you can apply throughout your Web application's code.

One of the common techniques of the past and present is to use the Session object, but by simply using ASP.NET, you have so much more at your disposal. ASP.NET offers a wide variety of features and techniques to apply when working with state management. You might have used many of these techniques with Web applications that you developed in the past.

Caching on the other hand, although also focused on storing information, is a means to provide a better experience for your end users by making the application load and perform faster than otherwise. This chapter takes a look at both using state management and caching with your ASP.NET AJAX pages.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset