|
蓝森林 http://www.lslnet.com 2006年8月25日 8:28
[ASP]If语句多次嵌套判断,怎么无效?
每个参数的值我已经用Response.write IsClose返回看了!现在IsClose的值就是True,但是还是显示不出来,该主题已经结束的效果!仍然显示的是[回复]与[结束课题]二个,
请问那里有错误?帮忙看看If的嵌套,无法实现效果!~
目前的情况是用户已经登陆,并且IsClose=True,session("Username")=UserID这种情况!
<% If session("UserID")<>"" or session("Username")<>"" or session("Admin")<>"" then %>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#E7E3E7">
<tr>
<td width="70" height="25"><div align="right">欢迎您:</div></td>
<td width="100"><font color="#FF0000"><%=session("Username")%></font></td>
<td width="150">您已经登陆本站</td>
<td width="100"> <a href="User_Edit.asp?action=Password">修改密码</a></td>
<td width="100"> <a href="User_Edit.asp?action=Edit">修改资料</a></td>
<td width="300" height="30"> <a href="Login.asp?action=Logout">退出登陆</a></td>
</tr>
</table>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#E7E3E7">
<tr>
<td height="30">
<a href="Post.asp?ClassID=<%Response.Write ClassID%>">发布新课题<font color="#FF0000">(需要审核)
</font></a>
<%
'Response.Write IsClose 调试的时候用来显示该值的,已经显示为True了!
'Response.Write UserID 与下一个值完全一样
'Response.Write session("Username") 与上一个一样!
'Response.End()%>
<%If IsClose=True then%>
<font color=#FF0000>该课题已经被负责人关闭,无法回复!</font>"
<%else%>
<% if session("Username")=UserID then%>
<a href="Post.asp?ClassID=<%Response.Write ClassID%>&ID=<%Response.Write ID%>">回复该课题</a>
<a href="Close.asp?ID=<%Response.Write ID%>">结束该课题</a><font color="#FF0000">(结束课题以后将无法
回复)</font>
<% else%>
<a href="Post.asp?ClassID=<%Response.Write ClassID%>&ID=<%Response.Write ID%>">回复该课题</a>
<% End If
End If %>
</td>
</tr>
</TABLE>
<% else %>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#E7E3E7">
<tr>
<FORM name=login action=Login.asp?Action=Login method=post>
<td width="74" height="25"><div align="right">用户名:</div></td>
<td width="168"><input name=Username type="text"></td>
<td width="51">密 码:</td>
<td width="158"><input name=Password type="password"></td>
<td width="48"><INPUT type=submit class=btn value="登陆"></td>
<td width="257"> <a href="Register.asp">新用户注册</a></td>
</FORM>
</tr>
</table>
<% End If %> |
IsClose在哪里附值了?是否IsClose="true"? |
这个没问题,Iscloes是读取数据库里面的值,我已经在页首读取出来了!中间不是有一段注释了的Response.write嘛~!~确定了他是有值的,而且是True的!~~
但是就是无法实现我要的效果!郁闷 |
response.write IsClose=True看看 |
<%Response.Write IsClose
Response.Write UserID
Response.Write session("Username")
Response.Write IsClose=True
Response.End()%>
显示的结果是:
True满天星满天星False
怎么回事呢?确实 IsClose=True 的值是False!
这样如何解决? |
为什么2次的值显示的不一样呢?求解决办法 |
估计改成这样就可以了
<%If IsClose="True" then%>
|
非常感谢got,确实如此!~~加上引号就可以了!~~
郁闷,还没见过这种事情啊!~~
怎么搞的!
原来都没有过哦! |
变量类型问题 |
|