asp-classic – 请求与Request.QueryString

前端之家收集整理的这篇文章主要介绍了asp-classic – 请求与Request.QueryString前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这两个在VBScript中有什么区别?
Request("startDate")

Request.QueryString["startDate"]

请求(“startDate”)在哪里记录?我在这里看不到这个用法

http://www.w3schools.com/asp/asp_ref_request.asp

解决方法

ASP经典中的Request对象的官方文档如下: http://msdn.microsoft.com/en-us/library/ms524948%28VS.90%29.aspx

引用这个问题的相关部分:

All variables can be accessed directly by calling Request(variable)
without the collection name. In this case,the Web server searches the
collections in the following order:

  • QueryString
  • Form
  • Cookies
  • ClientCertificate
  • ServerVariables

If a variable with the same name exists in more than one collection,
the Request object returns the first instance that the object
encounters.

编辑:AnthonyWJones对这个问题做了一个很好的评论:避免使用Request(“name”)语法.事实上,这在上面的文档链接中提到:

It is strongly recommended that when referring to members of a
collection the full name be used. For example,rather than
Request.(“AUTH_USER”) use Request.ServerVariables(“AUTH_USER”). This allows the server to locate the item more quickly.

原文链接:https://www.f2er.com/aspnet/246414.html

猜你在找的asp.Net相关文章