Request. querystring ["ID"] can only read parameters named ID passed by parameters in the address bar.
Request ["ID"] is a composite function for reading data.
Its priority is
Querystring> form> cookies> servervariables
That is to say, if the address bar parameter named ID exists, the effect of request ["ID"] is similar to that of request. querystring ["ID.
If the address bar parameter named ID does not exist, request. querystring ["ID"] will return NULL, but request ["ID"] will continue to check whether there is a form submission element named ID. If not, check the cookie named ID. If the cookie does not exist, check the server environment variable named ID. It will make up to four attempts, and only returns NULL if all four attempts fail.
The following is the internal implementation code of request ["ID:
Public String This [String key]
{
Get
{
String STR = This. querystring [Key];
If (STR! = NULL)
{
Return STR;
}
STR = This. Form [Key];
If (STR! = NULL)
{
Return STR;
}
Httpcookie cookie = This. Cookies [Key];
If (cookie! = NULL)
{
Return cookie. value;
}
STR = This. servervariables [Key];
If (STR! = NULL)
{
Return STR;
}
Return NULL;
}
}