用下面的代码替换你的代码:
<td class="text2">
<%
if(contactInfo.isinservice==1){
%>
<img src="/image/stop.gif" width="15" height="15">
<%
}
%>
</td>

解决方案 »

  1.   

    <td class="text2"> 
    <%
    if (contactInfo.isinservice==1){
    %>
      <img src="/image/stop.gif" width="15" height="15">
    <%
    }else{
    %>
      &nbsp;
    <%
    }
    %>
    </td>
    是不是这个意思?
      

  2.   

    <td class="text2"> <%=contactInfo.isinservice==1?("<img src=\"/image/stop.gif\" width=\"15\" height=\"15\">"):("")%>  </td>