0
我已經使用了豐富的文本框控件ckeditor,在我的情況下,當對文本進行任何格式化時,格式化文本將填充到datagrid中。但是,我只想提取純文本格式並在填充時將數據長度修剪爲80個字符。從asp.net中的HTML文本中提取純文本
更新答案的查詢如下
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (txtEditorAnswer.Text.Trim() != string.Empty)
{
int intIsUpdated = 0;
string strUpdateQuery = "UPDATE M_QA SET ANSWER = '" + txtEditorAnswer.Text.Trim().Replace("'", "''")
+ "', UPDATED_ON = getDate(), UPDATED_BY = '" + this.Session["UserId"].ToString()
+ "' WHERE PK_ID = " + _currentQuestionId + " AND IS_ACTIVE = 1";
,並在網格填充數據的查詢如下:
protected void LoadQA(int intQuestionId)
{
string strSelectQuery = "SELECT REPLACE(TITLE, '\n', '<br />') TITLE, REPLACE(DESCRIPTION, '\n', '<br />') DESCRIPTION, "
+ "ANSWER, FK_OWNER_ID, CREATED_ON FROM M_QA WHERE PK_ID = "
+ intQuestionId + " AND IS_ACTIVE = 1";
可以PLZ一些哥們幫我!