图片在根目录的HdNewsImg下,叫defnewspic.jpg
- VBScript code
<%if rs("news_imgpath")="" then Response.Write "<img src=HdNewsImg/defnewspic.jpg />" else%> <img src="<%=rs("news_imgpath")%>" width="160" height="120" /> <%end if%>
------解决方案--------------------
<%if rs("news_imgpath") <> " " then %>
改为
<%if rs("news_imgpath") <> "" then %>
不要多加空格