2011-06-02 41 views
1

我插入下文第到數據庫。然而,同時顯示它被顯示爲(這是不期望的):顯示段

使用該網站的受使用的以下術語:•內容本網站的頁面僅供您的一般信息使用。它可隨時更改,恕不另行通知。 •公司或任何第三方提供任何擔保或保證的準確性,

期望款觀點: 。使用本網站須遵守下列使用條款:

•網頁的內容本網站僅供您的一般信息和使用。它可隨時更改,恕不另行通知。 •我們或任何第三方均不對其準確性提供任何擔保或保證。

我們怎樣才能在asp.net/C#

回答

0

插入實現這一目標的完整的HTML到數據庫中,並設置成格爲innerHTML的

<div id="div" runat="server"></div> 



div.InnerHtml = "paragraph from Database which saved as HTML";" 
+0

我正在使用編輯器。 – user650922 2011-06-08 10:56:43

+0

我正在使用編輯器來插入文本。 – user650922 2011-06-08 10:57:57

+0

哪位編輯,fck編輯? – Saurabh 2011-06-08 12:01:28

0

使用paragraph標籤。

<p>The use of this website is subject to the following terms of use:</p> 

<p>• The content of the pages of this website is for your general information and use only. It is subject to change without notice. • Neither we nor any third parties provide any warranty or guarantee as to the accuracy.</p> 
0

在將文本放入控件之前,可能需要用br標記替換換行符/回車符。或者,可能將br標記放入段落文本中,並保存在數據庫中。

要替換,你可以使用與string.replace()

字符代碼可以在這裏找到http://www.asciitable.com/

查找字符代碼10和13.您應該檢查你正在試圖替代文本,找出兩個代碼是否在字符串中,或​​者只是其中的一個。