当前位置:首页 > ASP教程 > 应用技巧

ASP IE地址栏参数的判断

当地址栏没有参数"id"时: 
复制代码 代码如下:

request.querystring["id"] == null
convert.tostring(request.querystring["id"]) == null

  注意这样会出错:
  request.querystring["id"].tostring();
  当地址栏有参数"id",但没有赋值的时候: 

复制代码 代码如下:

request.querystring["id"] == ""
request.querystring["id"] == string.empty
convert.tostring(request.querystring["id"]) == ""
convert.tostring(request.querystring["id"]) == string.empty

同时判断二个条件的时候: 
复制代码 代码如下:

if ("" + request.querystring["id"] == "") {...}
if (("" + request.querystring["id"]).length == 0) {...}


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!