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; }
|
请发表评论