zoukankan      html  css  js  c++  java
  • Request.Params["ID"](小结)

    从页面的

    QueryString 、Form、Cookies、ServerVariables 里检索名称为“ID”的值。包括控件ID 和name

    优先级顺序为
    QueryString > Form > Cookies > ServerVariables



    以下是来自 Reflector 的 HttpRequest 类的部分参考代码。

    public NameValueCollection Params
    {
        get
        {
            if (HttpRuntime.HasAspNetHostingPermission(AspNetHostingPermissionLevel.Low))
            {
                return this.GetParams();
            }
            return this.GetParamsWithDemand();
        }
    }

    private NameValueCollection GetParams()
    {
        if (this._params == null)
        {
            this._params = new HttpValueCollection(0x40);
            this.FillInParamsCollection();
            this._params.MakeReadOnly();
        }
        return this._params;
    }

    private void FillInParamsCollection()
    {
        this._params.Add(this.QueryString);
        this._params.Add(this.Form);
        this._params.Add(this.Cookies);
        this._params.Add(this.ServerVariables);
    }

    Request.QueryString Get值(一般是URL)

    Request.Form post值(一般是name)

    Request[] get post

  • 相关阅读:
    SQL SELECT DISTINCT 语句
    SQL SELECT 语句
    SQL 语法
    Linux 命令大全
    MySQL 安装
    Nginx 安装配置
    linux yum 命令
    Linux 磁盘管理
    Linux 文件与目录管理
    Linux 用户和用户组管理
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/1496741.html
Copyright © 2011-2022 走看看