在TextBox中显示换行的文字以及将换行的文字显示在页面上保存换行的文字

string bulletinContent = this.Server.HtmlEncode(txtcontent.Text.ToString().Replace("'", "")).Replace("\r\n", "<br/>").Replace(" ", " ");

将有换行文字的字符串显示在TextBox中,原来是换行的,在TextBox中显示的也是换行的:

txtcontent.Text = board.BulletinContent.Replace("<br/>","\r\n");

posted @ 2013-10-15 21:19  源起  阅读(630)  评论(0编辑  收藏  举报