服务器端asp程序可以接收html页面上的form参数,但是如何实现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) {...}