Tutorials » AspNet tutorials »

ASP.NET Response object

This article explains the ASP.NET Response object and various methods of it.

What is a Response ?

In the web server world, a Response is exactly opposite to the Request. A 'Response' is the message sent from the web server to the client, when client makes a 'Request'. For each request from a client, the server gives a response, unless there is an error.

When you type a URL in a web browser or when you click on a hyper link in any web page, your browser makes a 'Request' to the server for the specific URL. Then server process the request and send a response back.

How does a browser process the Response ?

The response includes several information about the page requested including the cookies to be saved on the client machine, the actual content to be displayed to the user etc. The browser accepts the response and processes it. Browser does several things including saving the cookies, checking the security etc and then displays the page content to the user. Note that displaying the page content to the user in the browser is only a small portion of the actual work.

ASP.NET Response Object

The ASP.NET provides a class called HttpResponse which is defined in the namespace System.Web. This class provides various methods and properties which help you use various information related to a web response.
An instance of this class is created by default in all the pages, so that you can use this object without creating again each time in all the pages. The name of this object is Response.
In old ASP days, the Response object was the only way to write data to the page. ASP.NET provides the event handling mechanism and web controls so that you can write content to the page in an easier way.

Next Chapter: Frequently used Methods and Properties of Request object
Previous Chapter: ASP.NET Request Object
More Chapters: ASP.NET Tutorials
More Tutorials: Tutorial Index

Top Contributors
    Last 7 Daysmore...

    Awards & Gifts

    Online Members

    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India