after the Beef Brisket press release system and HTML study of the B/s development process has some understanding. Although the previous use of a lot of knowledge, but the production of web pages can only be said to know it, when learning the explanation of the ASP.
Today, the request and response objects used to communicate between the client and server.
Request : When a user makes a request to a Web application using a Web browser, the client information is sent to the server. The server receives an HTTP request that contains all query string parameters or form parameters, cookie data, and browser information. Encapsulates these request information as Requset objects when running in ASP.
Response: encapsulates the response of the Web server to a client request, which is used to manipulate HTTP information and return the results to the requestor.
Both the request and the response have many properties and methods. The first stage only focuses on the redirect and write methods of the Response object,the form and QueryString collection of the Request object.
With a simple user login interface example to illustrate:
The user enters the user name and password information and then jumps to the main page and displays the user name and password entered in the main page.
1. New Login.aspx is written in the Source view edit area:
<span style= "font-family:kaiti_gb2312;" > Username: <asp:textbox id= "txtUserName" runat= "Server" ></asp:TextBox> <br/> Password: <asp: TextBox id= "txtpwd" runat= "Server" ></asp:TextBox> <br/> <asp:button id= "Button1" runat= " Server "text=" login "onclick=" Button1_Click "/></span>
2. Write in Login.aspx.cs:
<span style= "font-family:kaiti_gb2312;" > protected void Button1_Click (object sender, EventArgs e) { Response.Redirect ("main.aspx?username=" + txtUsername.Text + "&password=" + txtpwd.text);//implied get commits, so use requset.querystring}</span> at the back
3. New main.aspx:
<span style= "font-family:kaiti_gb2312;" >protected void Page_Load (object sender, EventArgs e) { Response.Write ("User name:" + request.querystring[" Username "] +" <br> ");//Use the QueryString property of request to get the user name passed in the URL Response.Write (" Password: "+ request.querystring[" Password "] +" <br> "); } </span>
redirect redirects the client to the new URL.
Write is used to output information to the client display. It can output a character array, a string, an object, or a character.
relationship between request and response:
the properties and methods of request and reponse still have a lot to learn next.
Asp. NET Request and Response objects