Request.Form is to obtain the form data submitted by post;
The main request.querystring is to get the address bar parameter or the data to be submitted in getting way
The request contains both of these methods, which are queried for variables in both Request.QueryString and Request.Form. But priority gets the data submitted by the Get method, i.e. Request.QueryString
Request: Includes both of the above methods (get the data submitted by giving precedence), it will be searched in QueryString, Form, ServerVariable.
And sometimes you get different results. If you only need one of the data in a Form, but you use request instead of Request.Form, then the program will also be searched in QueryString, servervariable.
If it happens that you have the same name in your querystring or servervariable, you will not get the value you originally wanted.
Request.QueryString is used to receive addresses inside? The contents of the xx=xx behind
And Request.Form is used to receive data submitted by the form.
For example, request ("offline")
The field value of whichever method is used can be read
Request.Form refers to the data submitted by form. And request.querystring refers to the use of the URL submitted over. You are using the Login.asp?offline=true, this is of course the URL submitted.
Request.Form and request.querystring Two receive parameters from the source, which is to receive parameters from form forms, which are parameters from the URL.
You have this sentence logon.asp?offline=true this is the pass parameter of the URL.
If you want to use Request.Form (), the page must have at least a form, such as:
<form name=form1 method=post action=logon.asp>
<input type=text "" >
So after the form has been submitted, you can use Request.Form ("user") to get the value of the text box passed over.
The difference between request.querystring and Request.Form Request.QueryString is that the unsafe
Request.Form read using the Post method
is read using the
get method In the form form, see if you are get or post
Summary
1.request.form method, which is used to receive form variables (POST method)
2.request.querystring method, which receives the URL parameter (get method)
3.Request objects can also not specify the specific use of QueryString or form methods, such as request ("variable"), because it can be automatically recognized, but it is indicated as good, otherwise, it will take a bit of time to determine its own, affecting the efficiency of program execution. Request: Includes both of the above methods (get the data submitted by giving precedence), it will be searched in QueryString, Form, ServerVariable.
In addition to the receiving method is different, there is the transfer of data size problem, Request.Form method can receive data without restrictions, and request. QueryString can only receive data less than 2KB of data, of course, the latter is faster than the implementation of the former. General requests are used when requesting queries from the database. QueryString method, because the query is only a few keywords, there is no need to use the Request.Form method and cause the query speed slow. In addition, request. The QueryString method also displays the data information in the client browser address bar and is less secure. The Request.Form method does not have these problems, so it is widely used in many text fields to submit data and user login.
The difference between ps:get and post
The Get method exposes the parameters and parameter values to the visitor, so it is unsafe. and the URL transmission parameters are limited in length, but convenient.
The Post method can transmit a large parameter length, and the parameters and parameter values are not visible to the visitor.
Summarize:
When you use Request ("Reportdate") to read the corresponding value of the passed data "Reportdate", both the Get and post mode parameters are readable. The reason is that it by default first use Request.QueryString read and then read with Request.Form, that is, do two times read the operation, the speed will naturally slow some, is not safe.
Example:
public string reportdate
{get
{return request.querystring[' reportdate ']}
The request object has five collections, which are described below:
QueryString
: Used to get information from the query string that the client attached to the URL address.
Example: stra=request.querystring ["Struserld"]
Form
: Used to get the information that the client entered in form forms. (The form's method property value needs to be post)
For example: stra=request.form["Struserld"]
Cookies
: Used to get cookie information for the client.
For example: stra=request.cookies["Struserld"]
ServerVariables
: Used to get the header information from the HTTP request information issued by the client and server-side environment variable information.
For example: stra=request.servervariables["REMOTE_ADDR"], return the client IP address
ClientCertificate
: Used to obtain authentication information for the client
For example: stra=request.clientcertificate["ValidForm", returns a valid start date for a Web site that requires security verification.