zoukankan      html  css  js  c++  java
  • js获取参数值和asp.net获取参数值

    var orderCode = getCode("orderCode");

    --js 获取url参数值

    function getCode(orderCode) {
                new RegExp("(^|&)" + orderCode + "=([^&]*)").exec(window.location.search.substr(1));
                return RegExp.$2
            }

      /// <summary>
            /// 取HttpRequest请求中名称为ParamName的参数的值,包括QueryString和Form参数,没有该参数时取DefaultValue为默认值。QueryString参数优先于Form参数使用
            /// </summary>
            public static string GetParam(HttpRequest Request, string ParamName, string DefaultValue)
            {
                string ParamValue = string.Empty;
                if (DefaultValue != string.Empty)
                    ParamValue = DefaultValue;
                if (Request.QueryString[ParamName] != null)
                {
                    ParamValue = Request.QueryString[ParamName].Trim();
                }
                if (Request.QueryString[ParamName] == null)
                {
                    if (Request.Form[ParamName] != null)
                    {
                        ParamValue = Request.Form[ParamName].Trim();
                    }
                }
                return ParamValue;
            }

  • 相关阅读:
    javascript模块化进阶
    javascript模块化基础
    css架构探索
    javascript函数基础概念 (补充完结)
    聊聊圣杯布局
    javascript函数基础概念
    yum提示This system is not registered with RHN.RHN support will be disabled.
    Linux分区和挂载硬盘
    Thunderbird扩展
    yum install nginx
  • 原文地址:https://www.cnblogs.com/chenjt/p/3003410.html
Copyright © 2011-2022 走看看