Request| Object | client | Data in ASP the request object is a very important object to obtain the client submitting data, and we are very familiar with it.
Even so, people often ask me how the following kinds of writing are different, in the end how to write?
Also, I have seen many people write code, all are request (""), of course, this writing is not wrong.
It's just that you should pay attention to the request object has several sets to obtain the data submitted by the client, commonly used Querystring,form and ServerVariables.
And no matter what kind of collection can actually be obtained directly from the request (""), there is a problem here, if the Get method and post method submitted the same variable, such as USERNAME=CQQ, then you use Request ("username") Did you get the data that came out of you or did you post it?
So, the problem here, we should think of, request from these several sets of data is in order, the former to the following order is Querystring,form, and finally is servervariables. The request object, in this order, searches for the variables in these sets, and if there is a match, the rest is terminated. So the above example request ("username") takes the actual data submitted by the Get method.
Therefore, in order to improve efficiency, reduce the unnecessary search time, but also for the Code of Procedure, we suggest that we still use request. The way to assemble is better, such as Request.Form ("username").
Here is a test example, after the submission, you can directly after the address of the add? Username=test to test:
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.