Chapter 14. Introduction to the Provider Model

Before you begin using the provider model introduced in ASP.NET 2.0, take a step back. You probably already know that ASP.NET is a way to build applications for the Internet. For the Internet means that an application's display code travels over HTTP— which is a stateless protocol. ASP.NET works with a disconnected architecture. The simple nature of this model means that requests come in and then responses are sent back. On top of that, ASP.NET does not differentiate one request from another. The server containing an ASP.NET application is simply reacting to any request thrown at it.

This means that a developer building a Web application has to put some thought into how users can remain in context between their requests to the server as they work through the application. Keeping a user in context means recording state, the state of the user, to some type of data store. This can be done in multiple ways, and no one way is the perfect way. Rather, you have to choose one of the available methods.

You can read about maintaining state in an ASP.NET application in Chapter 21, "State Management."

State can be stored via multiple methods, some of which include:

  • Application State

  • Session State

  • The Cache Object

You use all these methods on the server, but you can also employ your own custom methods—such as simply storing state in a database using your own custom schema. It is also possible to write state back to the clients, either directly on their ...

Get Professional ASP.NET 2.0 Special Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.