求助ASP变量里面套变量怎么套啊,郁闷死了

来源:百度知道 编辑:UC知道 时间:2024/06/22 09:19:59
下面是完整的正常的
<%temp1=temp1&vbcrlf& "<tr align=center valign=top><td width='15%'><FONT color=#006699>" &rs("name") &"</font></td><td width='6%'>" & rs("sex") & "</td><td width='10%'>" & rs("City") & "</td><td width='32%'>" &rs("add")& "</td></tr>"%>

我想实现一个
当rs("add")的值大于10个字符的时候
输出...
否则就正常输出

也就是实现页面美观,防止表格撑大

<%
a=len(rs("ADD"))
if a>10 then
response.write(left(rs("ADD"),10)&"…")
else
response.write(rs("ADD"))
end if
%>
这杨的用法在上面行不通
郁闷死

老提示未结束的变量

或者就是语法错误

郁闷!!!!!

变量里面套变量糊涂了

拜请高手指点

感激不尽!!
大师,你的我用了,也是未结束的变量
方法和你的一样

建议你拆开写 比较直观,以后修改也方便:

<%
temp1=temp1&vbcrlf
temp1=temp1&"<tr align=center valign=top>"
temp1=temp1&"<td width='15%'>"
temp1=temp1&"<FONT color=#006699>" &rs("name") &"</font>"
temp1=temp1&"</td>"
temp1=temp1&"<td width='6%'>" & rs("sex") & "</td>"
temp1=temp1&"<td width='10%'>" & rs("City") & "</td>"

a=Rs("add")
if len(a)>10 then
a=Left(a,10)&"..."
end if

temp1=temp1&"<td width='32%'>"&a&"</td>"
temp1=temp1&"</tr>"
%>

response.write("<tr align=center valign=top><td width='15%'><FONT color=#006699>" &rs("name") &"</font></td><td width='6%