asp读取数据库内容如何让它以原格式显示?

Abingdz 2005-06-13 11:52:46
asp读取数据库内容如何让它以原格式显示?
如空格,换行?
在线积求!
...全文
142 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
随缘而聚 2005-06-13
  • 打赏
  • 举报
回复

Function chgTextArea(strVal)
if trim(strVal)<>"" then
strVal=replace(strVal," "," ")
strVal=replace(strVal,vbcrlf,"<br>")
strVal=replace(strVal," ","  ")
chgTextArea=strVal
else
chgTextArea=" "
end if
end Function
wangwm 2005-06-13
  • 打赏
  • 举报
回复
使用该函数转换:
function htmlEncode(str)
dim tmp

if not IsNull(str) then
tmp = Replace(str,"<","<")
tmp = Replace(tmp,">",">")
tmp = Replace(tmp,chr(34),""")
tmp = Replace(tmp,chr(13) & Chr(10),"<br>")
tmp = Replace(tmp," ","  ")
else
tmp = null
end if

htmlEncode = tmp
end function
dh20156 2005-06-13
  • 打赏
  • 举报
回复
写入时转换,如:chr(13) -> <br>,chr(32) ->  

28,390

社区成员

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

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