tianshu 发表于 2008-5-11 13:56

关于地址栏参数

我写了一个ASP文件22.asp,代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<%
if request.QueryString("page")="" then
        page=1
else
        page=request.QueryString("page")
end if
zpage=5
if page<zpage then
        response.Write "aaa"
else
        response.Write "bbb"
end if
%>
</body>
</html>
当我运行22.asp?page=1时,输出:
bbb
明明page<zpage条件成立,应该输出aaa,为什么却输出bbb呢?

yms123 发表于 2008-5-11 16:03

if CInt(page)<zpage then

multiple1902 发表于 2008-5-11 18:53

request.QueryString集合的元素类型是字符串。

tianshu 发表于 2008-5-12 18:24

哦,太谢谢了

页: [1]

编程论坛