在你的aspx文件中相应的显示控件中加上这一句:style="WORD-BREAK: break-all"

解决方案 »

  1.   

    请查看.net文档,关于字符串操作的。举例说:(VB.net)dim str as string
    str=你的字符串
    str=str.Replace(Chr(13) & Chr(10), "<br>")    '把回车替换为<br>,如果是C#,就是前 面为\n\t
    str=str.Replace(" ","&nbsp;")     '替换空格好了。当然,你还能替换“<”,“>”等等等等。这里要注意一个问题,处理后的STR如果送到LABEL是没有问题的。如果再送到另个TEXTBOX,建议再替换回来。
      

  2.   

    Content=Regex.Replace(Content,"<","&lt;");    //过滤HTML代码
    Content=Regex.Replace(Content,">","&gt;");
    Content=Regex.Replace(Content,"\r","<BR>"); //回车
    Content=Regex.Replace(Content," ","&nbsp;&nbsp;"); //空格
    Content=Regex.Replace(Content,"\t","&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");//水平 Tab