How to display the text in the second ck editor with strikes while extracting from database

Posted by Manicse under .NET Framework on 12/28/2016 | Points: 10 | Views : 229 | Status : [Member] | Replies : 0
Hi,

In my application i need to add a button below ckeditor and on clicking that link button i need to display two ckeditors on ck editor is to display the text that is given in ckeditor and another ckeditor is to display the error text that means the process is in ckeditor,.
We will have large amount of text on where user can edit some text in it and on clicking the button the text gets saved in database and now i need to add another button and on clicking that button i need to retrive the data that is saved in database and display the text that is saved in database in two columns as transcribed text and and compared text i am able to retrive the text into two ckeditors but for the text in second ck editor i need to display strikes.

protected void Page_Load(object sender, EventArgs e)
{
if (Session["uid"] == null)
{
Response.Redirect("Login.aspx");
}
adm = new Admin();
if (!IsPostBack)
{
BindGrid();
}
}
protected void BindGrid()
{
string query = "select ID,TranscriptionText,ComparedText from MTworkStatus where ID='" + 300 + "'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string id = dt.Rows[i]["ID"].ToString();
string TranscriptionText = dt.Rows[i]["TranscriptionText"].ToString();
string ComparedText = dt.Rows[i]["ComparedText"].ToString();
Session["TranscriptionText"] = TranscriptionText.ToString();
Session["ComparedText"] = ComparedText.ToString();
}

}
string ttext = Session["TranscriptionText"].ToString();
string Text1 = ttext.ToString();
Text1 = Text1.Replace("<del", "<s><span");
Text1 = Text1.Replace("</del", "</s></span");
Text1 = Text1.Replace("<s style=", "<s><span style=");
CKEditorControl1.Text = Text1;

string ctext = Session["ComparedText"].ToString();
string Text = ctext.ToString();
Text = Text.Replace("<del", "<s><span");
Text = Text.Replace("</del", "</s></span");
Text = Text.Replace("<s style=", "<s><span style=");
CKEditorControl2.Text = Text;
}
}


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div id="main" style="background-color: #E2E6E9;">
<center><h3>TRANSCRIPTION TEXT</h3></center>
<table>
<CKEditor:CKEditorControl ID="CKEditorControl1" BasePath="/ckeditor/" runat="server" Width="900px" Height="163px"></CKEditor:CKEditorControl>

</table>
<br />
<center><h3>COMPARED TEXT</h3></center>
<table>
<CKEditor:CKEditorControl ID="CKEditorControl2" BasePath="/ckeditor/" runat="server" Width="900px" Height="163px"></CKEditor:CKEditorControl>

</table>
</div>

</asp:Content>


Mani.R


Responses

(No response found.)

Login to post response