那就用回textbox 显示.
textbox 加样式:<asp:textbox cssclass="content" ....content
{
border: 0px;
OVERFLOW-Y: visible;
font-size: 12px; 
width: 600px;
line-height: 150%;
font-family: '&ETH;&Acirc;&Euml;&Icirc;&Igrave;&aring;', Verdana;
height: 40px;
background-color: transparent;
cursor:default;
}

解决方案 »

  1.   

    保存为Image型的可以吗?Text型保存为文本型的,Image型保存为二进制的.
      

  2.   

    在Label控件中是会这样,你要不试试把你的回车换行在存入数据库时用字符串替换函数来把这些回车换行替换为html的代码,然后在显示。这样或许可以。请不久也有人问只要的问题。你试试吧。祝你成功,同时帮你顶
      

  3.   

    存入数据库的时候先把相应的转换一下,用下面的函数把输入的字符串转换一下public static string MyHtmlEncode(string strContent)
    {
    strContent=strContent.Replace("&","&amp");
    strContent=strContent.Replace("'","''");
    strContent=strContent.Replace("<","&lt");
    strContent=strContent.Replace(">","&gt");
    strContent=strContent.Replace("chr(60)","&lt");
    strContent=strContent.Replace("chr(37)","&gt");
    strContent=strContent.Replace("\"","&quot");
    strContent=strContent.Replace(";",";");
    strContent=strContent.Replace("\r\n","<br>");
    strContent=strContent.Replace(" ","&nbsp");
    return strContent;
    }
      

  4.   

    SVG(ben) 的方法也很好,你可以用Css来把文本框的边框来去掉,感觉就像一个Label控件。好方法。
      

  5.   

    lbl.Text = str.Replace(System.Environment.NewLine,"<br>");
      

  6.   

    那就用TextBox,只是把边框设置为没有一样
    或者显示在Span、Label中,把回车换行符换成html的换行标签
      

  7.   

    如果某段文字前有多个空格怎么办?
    比如文件标题要显示在中间还有就是文件中可能有连接或表格之类的HTML语句,如果把空格换掉就不行了。
      

  8.   

    你可以不用label或TextBox直接把内容打出来:
    this.Controls.Add(new LiteralControl("<FONT SIZE=2 color=#000066><B>"+myReader.GetString(1).ToString()+"</B></FONT>"));
      

  9.   

    private string formatString(string str)
    {
    str=str.Replace(" ","&nbsp;");//处理空格
    str=str.Replace("<","&lt;");//处理小于号
    str=str.Replace(">","&gt;");//处理大于号
    str=str.Replace("\n","<br>");//处理换行
    return str;
    }
    private string formatString_too(string str)
    {
    str=str.Replace("&nbsp;"," ");//处理空格
    str=str.Replace("&lt;","<");//处理小于号
    str=str.Replace("&gt;",">");//处理大于号
    str=str.Replace("<br>","\n");//处理换行
    return str;
    }