Week-01

=Week 01= media type="custom" key="24989590"

Describe these terms: HTTP request, HTTP response, postback, and round trip.

 * === A web browswer requests a page froma web server by sending the server an HTTP message known as an HTTP Request. The HTTP Request includes the name of the HTML file requested and thye internet address of both the browser and the web server. ===
 * === A user working with a browser can initiate a HTTP request in several ways: by typing the URL or by clicking a link that refers to a webpage. ===
 * === A Web server replies to an HTTP request by sending a message known as HTTP Response back to the browser. The HTTP Response contains the address of the browser and the server as well as the HTML document that is returned. ===
 * After the page is displayed the user can interact with it using its controls. Some of these controls let the user post the page back to the server whcich is called postback. then the page is processed again using the data the user entered. the process that begins with the user requesting a web page and ends with the server sending a response back back to the client is called a round trip

**Explain why HTTP is called a stateless protocol, and list the four features for managing state that are provided by ASP.NET.** A new instance of the Web page class is created each time the page is posted to the server. In traditional Web programming, this would typically mean that all information associated with the page and the controls on the page would be lost with each round trip. For example, if a user enters information into a text box, that information would be lost in the round trip from the browser or client device to the server.

To overcome this inherent limitation of traditional Web programming, ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis. These features are as follows:


 * 1) View state
 * 2) Control state
 * 3) Hidden fields
 * 4) Cookies
 * 5) Query strings
 * 6) Application state
 * 7) Session state
 * 8) Profile Properties

View state, control state, hidden fields, cookies, and query strings all involve storing data on the client in various ways. However, application state, session state, and profile properties all store data in memory on the server. Each option has distinct advantages and disadvantages, depending on the scenario.

ASP.NET provides a feature called profile properties, which allows to store user-specific data. This feature is similar to session state, except that the profile data is not lost when a user's session expires. The profile-properties feature uses an ASP.NET profile, which is stored in a persistent format and associated with an individual user. The ASP.NET profile allows you to easily manage user information without requiring you to create and maintain user's own database. In addition, the profile makes the user information available using a strongly typed API that it is possible to access from anywhere in the application. Any type of objects can be stored in the profile. The ASP.NET profile feature provides a generic storage system that allows you to define and maintain almost any kind of data while still making the data available in a type-safe manner.
 * Profile Properties**

Query Strings
A query string is information that is appended to the end of a page URL. A typical query string might look like the following example:

http://www.contoso.com/listwidgets.aspx?category=basic&price=100

In the URL path above, the query string starts with a question mark (?) and includes two attribute/value pairs, one called "category" and the other called "price."

Query strings provide a simple but limited way to maintain state information. For example, they are an easy way to pass information from one page to another, such as passing a product number from one page to another page where it will be processed. However, some browsers and client devices impose a 2083-character limit on the length of the URL.

__Security Note__ Information that is passed in a query string can be tampered with by a malicious user. Do not rely on query strings to convey important or sensitive data. Additionally, a user can bookmark the URL or send the URL to other users, thereby passing that information along with it. For more information, see ASP.NET State Management Recommendations and How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings.

State Management in ASP