ASP 同个页面 根据不同的参数 显示不同的连接

来源:百度知道 编辑:UC知道 时间:2024/06/27 06:54:13
我有一个页面 要根据连接传过来的字段来显示这个页面的内容
代码我应该怎么写?
比如我带的连接是http://域名/id=3
我这个页面需要根据ID=3这个参数显示出
你好,现在是ID=3
同理:如果连接是http://域名/id=2的话
页面显示:你好,现在是ID=2

希望不要经过数据库
只在页面做简单判断就好
<%
if request("id") = "3" then
response.write "你好,现在是ID=3 "
else if request("id") = "2" then
response.write "你好,现在是ID=3 "
end if
%>
到货缺少END

<%
if request("id") = "3" then
response.write "你好,现在是ID=3 "
elseif request("id") = "2" then
response.write "你好,现在是ID=3 "
end if
%>

或者用下面的。
<% dim myid
myid=request("id")
select case myid
case "2"
response.write "你好,现在是ID=2 "
case "3"
response.write "你好,现在是ID=3 "
end select
%>

两种方法都可以的。。。

那简单啊,直接做成超级链接不玩了

if request("id") = "3" then
response.write "你好,现在是ID=3 "
else if request("id") = "2" then
response.write "你好,现在是ID=3 "
end if

试试看.