O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Context

The complement to the application and page events is the context, which is provided by ASP.NET. The available contexts allow you to do the following:

  • Get information about the request received from the client.
  • Configure aspects of the response that will be returned.
  • Issue instructions to the ASP.NET server as the request is processed.

The ASP.NET contexts are request, response, and server. Let’s see how they can be put to use.

The Request Context

You can get details of the request made by the client through the Page.Request property, which returns an instance of the System.Web.HttpRequest class. To demonstrate this class, let’s make some changes to the Default.aspx web page in the example project, as shown in Listing 5-8 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required