asp高手进来帮忙解决下这个问题!

来源:百度知道 编辑:UC知道 时间:2024/06/15 10:15:25
if request("shopxpbe_id")=60 then
response.Redirect "xuni.asp"
else
response.Redirect "shiwu.asp"
end if
%>
当shopxpbe_id的值等于60时显示xuni.asp网页的内容,当shopxpbe_id的值不等于60时显示shiwu.asp网页的内容,该怎么做~怎么写这段程序~请高手给写下~谢谢·!

60是数字型变量时使用引号包含60。
<%
If request("shopxpbe_id")="60" Then
response.Redirect "xuni.asp"
Else
response.Redirect "shiwu.asp"
End If
%>

如果是数字形变量,你的代码就是正确的。

你这里使用的是request传递参数的,建议最好还是使用数字形传递,如果是字符型,转换一下:
<%
shopxpbe_id = CInt(request("shopxpbe_id"))
If shopxpbe_id = 60 Then
response.Redirect "xuni.asp"
Else
response.Redirect "shiwu.asp"
End If
%>

if request("shopxpbe_id")="60" then
response.Redirect "xuni.asp"
else
response.Redirect "shiwu.asp"
end if
%>