ASP request.querystring ("id") and request ("id") Difference _ Application Skills
Source: Internet
Author: User
Request from several sets of data is in order, the former to the following order is Querystring,form, and finally ServerVariables. The request object, in this order, searches for the variables in these sets, and if there is a match, the rest is terminated.
Now we're going to analyze your problem.
Let's say there's a page test.asp?id=111
Here our page is using GET method. The Request.QueryString ("id") is the same as the request ("id"), and if you do not specify a collection of request, you will first search from QueryString.
And if our page is using the Post method to send the data to the test.asp, then using Request.QueryString ("id") is not possible (he can only take get), but to use Request.from ("id"), and if the request ("id") He can also get the data, but first detect the value of querystring, the speed is obviously slow.
Here is an example of a test that you can look at:
<%
If Request ("submit") <> "then"
Response.Write "Direct fetch:" & Request ("username") & "<br>"
Response.Write "Fetch get:" & Request.QueryString ("username") & "<br>"
Response.Write "Take post:" & Request.Form ("username") & "<br>"
End If
%>
<form name=form1 action= "" method=post>
<input type=test name= "username" value= "Postuser" >
<input type=submit name= "Submit" value= "Test" >
</form>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.