in the case of "soft" wrapping, "Text is displayed with wordwrapping and submitted without carriage returns and line feeds", seehttp://msdn.microsoft.com/workshop/author/dhtml/reference/properties/wrap.asp?frame=true
解决方案 »
- asp.net 部署WEB程序到IIS7
- 电台网络直播
- 关于将excel导入access的问题,出现错误,请高手帮忙看下,谢谢了!
- 怎样 多个aspx 页使用一个aspx.cs 代码文件
- 布局问题~! 高手进~ 急!!! 100分 求解! 混分别进!~ 不懂免进!~表达能力差免进!~~
- 急:GridView的PagerTemplate问题
- 一个论坛的调试和运用问题??
- asp.net考核系统 怎么添加多个人一次
- 如何连接ACCESS数据库?
- 各位大虾,我用asp.net做了一个web application,采用add refrence的方式进行,为什么运行的时候报错呢?qiu
- 请问datagrid中的超级链接列能不能支持两个以上的字段参数?
- 用户控件与自定义控件的区别
往后台提交时不用转换,不会包含软回车的内容。
<%
Function coder(str)
Dim result,L,i
If IsNull(str) Then : coder="" : Exit Function : End If
L=Len(str) : result=""
For i = 1 to L
select case mid(str,i,1)
case "<" : result=result+"<"
case ">" : result=result+">"
case chr(34) : result=result+"""
case "&" : result=result+"&"
case chr(13) : result=result+"<br/>"
case chr(9) : result=result+" "
case chr(32) : result=result+" "
case else : result=result+mid(str,i,1)
end select
Next
coder=result
End Function %>
or you can use "textarea",like here
存入数据库后 这样读取
Private Function TransferString(ByVal str As String) As String Str = Str.Replace("<", "<")
Str = Str.Replace(">", ">")
Str = Str.Replace("'", "''")
Str = Str.Replace(" ", " ")
Str = Str.Replace("\n", "<br>")
Str = Str.Replace("\r\n", "<br>")
Str = Str.Trim()
Return str
End Function
private string formatString(string str)
{
str=str.Replace(" "," ");//处理空格
str=str.Replace("<","<");//处理小于号
str=str.Replace(">",">");//处理大于号
str=str.Replace("\n","<br/>");//处理换行
return str;
}