加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp-classic – 请求与Request.QueryString

发布时间:2020-12-15 19:30:46 所属栏目:asp.Net 来源:网络整理
导读:这两个在VBScript中有什么区别? Request("startDate")Request.QueryString["startDate"] 请求(“startDate”)在哪里记录?我在这里看不到这个用法: http://www.w3schools.com/asp/asp_ref_request.asp 解决方法 ASP经典中的Request对象的官方文档如下: ht
这两个在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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读