回 帖 发 新 帖 刷新版面

主题:一个条件语句的小问题,各位大侠帮帮小弟

<% if "&tztiujian&"=0 then%>
<img src="Image/jian1.gif" width="15" height="15">
<% else %>
<img src="Image/jian.gif" width="15" height="15">

小弟想法是,当tztiujian,这个数值是0的时候显示jian1.gif这个小图

当tztiujian,不是0的时候显示jian.gif这个图

小弟刚刚学ASP可以语法上有些不对,请各位大侠帮帮我,谢谢!!

回复列表 (共5个回复)

沙发

tztiujian 是什么?变量么?

<% if tztiujian=0 then%>
<img src="Image/jian1.gif" width="15" height="15">
<% else %>
<img src="Image/jian.gif" width="15" height="15">
<% end if %>
 

板凳

<%
if tztiujian=0 then
response.write("<img src=Image/jian1.gif" width="15" height="15">")
else 
response.write("<img src="Image/jian.gif" width="15" height="15>")
end if  
%>

3 楼

<%
if tztiujian=0 then
response.write("<img src=""Image/jian1.gif"" width=""15"" height=""15"">")
else 
response.write("<img src=""Image/jian.gif"" width=""15"" height=""15"">")
end if  
%>

4 楼

大侠们,还是不行啊。tztiujian是一个变量,在数据库中,这个变量的值就只有1和0两种。大家帮帮小弟吧

5 楼

<% if rs("tztiujian")=0 then%>
<img src="Image/jian1.gif" width="15" height="15">
<% else %>
<img src="Image/jian.gif" width="15" height="15">
<%
End If
%>

我来回复

您尚未登录,请登录后再回复。点此登录或注册