如何在页面中显示图像?为什么我的不能显示?

summer_sh 2001-11-28 10:27:02
<p>新闻图片:<br>
<%if len(cstr(objRst("Picture"))) <> 0 then%>
<img src="<%=objRst("Picture")%>" alt="新闻图片">

...全文
89 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
summer_sh 2001-11-28
  • 打赏
  • 举报
回复
是不是要把图片先保存在数据库中?
swans 2001-11-28
  • 打赏
  • 举报
回复

请注意你保存在数据库中的地址的正确。
lancelyc 2001-11-28
  • 打赏
  • 举报
回复
<p>新闻图片:<br>
<%if len(cstr(objRst("Picture"))) <> 0 then%>
<img src=<%=objRst("Picture")%> alt=新闻图片>

lancelyc 2001-11-28
  • 打赏
  • 举报
回复
应该""中嵌套''!!!!!!
fog 2001-11-28
  • 打赏
  • 举报
回复
也许这样比较好一些(只是一点点建议)
<%
if len(cstr(objRst("Picture"))) = 0 then
response.write "没有图片被选中"
response.end
else
%>
<img src="<%=objRst("Picture")%>" alt = "新闻图片">
<%
end if
%>
hnclg 2001-11-28
  • 打赏
  • 举报
回复
<%if len(cstr(objRst("Picture"))) <> 0 then%>
response.write "OK"
response.end
<img src="<%=objRst("Picture")%>" alt="新闻图片">

看看是否显示OK可能是条件为假!

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧