注册 登录
编程论坛 ASP技术论坛

asp 看看代码,有错吗??

long6062003 发布于 2008-08-16 11:24, 470 次点击
<p><a href="Main.asp?<%session("id")=1%>">qq</a></p>
<p><a href="Main.asp?<%session("id")=2%>">ww</a></p>
-----------------------------------------------------------
<% if session("id")=1 then%>
<!--#include file="../Include/Const.asp" -->
<%end if%>
<% if session("id")=2 then%>
<!--#include file="../Include/Const2.asp" -->
<%end if%>
1 回复
#2
tianyu1232008-08-16 11:29
<p><a href="Main.asp?<%session("id")=1%>">qq</a></p>   红色的部分,那能这么写啊!

这样写:

<p><a href="Main.asp?id=1">qq</a></p>
<p><a href="Main.asp?id=2">ww</a></p>
-----------------------------------------------------------
<% if request.querystring("id")=1 then%>
<!--#include file="../Include/Const.asp" -->
<%end if%>
<% if request.querystring("id")=2 then%>
<!--#include file="../Include/Const2.asp" -->
<%end if%>
1