请教!(在线等!成功结帐)

geniusxch 2003-08-18 05:54:20
这个是一个控制图片大小的代码?

怎么才能够正确的结束这个语句!
<% if rs1("pic1")="" then
response.Write""
else
response.Write"<img src="& rs1("pic1")&" width="146" height="161" >"

end if
%>
...全文
57 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
业余程序员 2003-08-19
  • 打赏
  • 举报
回复
如果你要把它放到某个表里的话可以这样:
<table width=146 height=161 ..>
<tr>
<td>
<% if rs1("pic1")="" then %>
<% response.Write "" %>
<% else %>
<img src=<% =rs1("pic1") %> width=146 height=161>
<% end if %>
</td>
</tr>
</table>
业余程序员 2003-08-19
  • 打赏
  • 举报
回复
你不懂高级的就用低级的用一下:
<% if rs1("pic1")="" then %>
<% response.Write "" %>
<% else %>
<img src=<% =rs1("pic1") %> width=146 height=161>
<% end if %>
不行的话~~~
那就你其它的程序有问题~~~
qwater 2003-08-19
  • 打赏
  • 举报
回复
response.Write "<img src=" &rs1("pic1")& "width=146 height=161 >"
jiejifeng 2003-08-19
  • 打赏
  • 举报
回复
response.Write"<img src="& rs1("pic1")&" width="146" height="161" >"

change to

response.write "<img src="& rs1("pic1")&" width=""146"" height=""161"" >"
zorou_fatal 2003-08-18
  • 打赏
  • 举报
回复
<%
if rs1("pic1")="" then
response.Write""
else
response.Write "<img src=" &rs1("pic1")& "width=""146"" height=""161"">"
end if
%>
或者
<%
if rs1("pic1")="" then
response.Write""
else
response.Write "<img src=" &rs1("pic1")& "width=146 height=161 >"
end if
%>
arcow 2003-08-18
  • 打赏
  • 举报
回复
下面是正确的,顺便 说一句,在有双引号时,里面不能再有双引号(对于要输出html语言是这样的除非是变量"&xxx&"),或者下面也可以不要单引号直接width=146 height=161

<% if rs1("pic1")="" then
response.Write""
else
response.Write"<img src="& rs1("pic1")&" width='146' height='161' >"

end if
%>



bananasmiling 2003-08-18
  • 打赏
  • 举报
回复
<% if rs1("pic1")="" then
response.Write""
else
response.Write"<img src='"& rs1("pic1")&"' width='146' height='161' >"

end if
%>
调用数据时.要使用'"&rs("xxx")&"' 进行调用.
lfengchao 2003-08-18
  • 打赏
  • 举报
回复
关键是 src='" & rs1("pic1") & "' 的写法

后边的 width=146,height=161不加符号也可以的
sgmao 2003-08-18
  • 打赏
  • 举报
回复
<% if rs1("pic1")="" then
response.Write""
else
response.Write"<img src='"& rs1("pic1")&"' width='146' height='161' >"

end if
%>

28,390

社区成员

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

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