当前位置: 首页 > 图文教程 > 网络编程 > ASP > asp中向文本框输出数据原样式的函数

ASP
asp 网站静态化函数代码html
asp利用Split函数进行多关键字检索
ASP动态include文件
用ASP开发网页需要牢记的注意事项
利用ASP发送和接收XML数据的处理方法
Session对象失效的客户端解决方法
一次性下载远程页面上的所有内容
asp模板引擎终结者(WEB开发之ASP模式)
浅谈 ASP 模板技术之参数传递
本人常用的分页代码
也谈采集入库的技术
简单分页函数一 常用
msxml3.dll 错误 ''800c0005''解决方案
[原创]本人常用的asp代码
生成所有页面的效果+分页生成
[原创]关于Script的Defer属性
[原创]asp截取字符串的两种应用
内容分页函数
[ASP]精华代码
asp提高首页性能的一个技巧

ASP 中的 asp中向文本框输出数据原样式的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 115 ::
收藏到网摘: n/a

从数据库输出信息时有转换函数,可以将回车空格按原样式输出。这段代码可向文本框原样输出代码。
复制代码 代码如下:

Function cc_f_textarea_html_encode(cc_f_t_h_e_str)
If Not IsNull(cc_f_t_h_e_str) And cc_f_t_h_e_str <> "" Then
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, ">", ">")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, "<", "<")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(13), "")
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(10) & CHR(10), vbCrLf)
cc_f_t_h_e_str = Replace(cc_f_t_h_e_str, CHR(10), vbCrLf)
cc_f_textarea_html_encode = cc_f_t_h_e_str
End If
End Function