I have CkEditor in my webpage,but the problem is while storing the data into database
it's storing like
text
![]()
,so while retrieving it's like unformated data,that's y I want to restrict the tags while storing the CKEditor data into database...can any one help me plz,its urgnt???
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 27, 2014, 10:00 PM EDT
config.ignoreEmptyParagraph = true;
config.forcePasteAsPlainText = false;
config.pasteFromWordCleanupFile = 'default';
config.pasteFromWordNumberedHeadingToList = false;
config.pasteFromWordPromptCleanup = false;
config.pasteFromWordRemoveFontStyles = true;//Change by Abrar
config.pasteFromWordRemoveStyles = true;
config.removeDialogTabs = "";
config.removeFormatAttributes = "lang,width,height,align,hspace,valign";
config.removeFormatTags = "big,code,del,dfn,em,i,ins,kbd,q,samp,small,strike,tt,u,var";
config.format_h1 = "{ element : 'h1' }";
config.format_h2 = "{ element : 'h2' }";
config.format_h3 = "{ element : 'h3' }";
config.format_h4 = "{ element : 'h4' }";
config.format_h5 = "{ element : 'h5' }";
config.format_h6 = "{ element : 'h6' }";
config.format_tags = 'p;pre;address;div';
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 10:06 PM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 10:12 PM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 27, 2014, 10:20 PM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 10:33 PM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 27, 2014, 10:39 PM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 10:53 PM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 27, 2014, 11:13 PM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 11:17 PM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 27, 2014, 11:19 PM EDT
public DataSet display()
{
SqlConnection con = DbCon.OpenCoonection();
SqlCommand cmd = new SqlCommand("USp_ViewRequirementdetails", con); cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds,"Tbl_RequirementModule");
DbCon.CloseConnection(); return ds;
}
viewDetails.aspx.cs:
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 28, 2014, 12:42 AM EDT
//HttpUtility.HtmlEncode(your string) //like for(i=0,iobjview.display().rows.count;i++) { //suppose your value in 1st columne try to change the loop and values then objview.display().rows[i].column[1] =HttpUtility.HtmlEncode(objview.display().rows[i].column[1])}
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 1:02 AM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 1:35 AM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 1:47 AM EDT
protected void Page_Load(object sender, EventArgs e)
{
for (int i =1; i > dt.Rows.Count;i++)
{
dt.Rows[0][11] = HttpUtility.HtmlEncode(dt.Rows[0][11]);
}
GridRec.DataSource = objview.display();
GridRec.DataBind();
}
bt im getting the error like:"There is no row at position 0"
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 28, 2014, 1:54 AM EDT
protected void Page_Load(object sender, EventArgs e)
{
for (int i =1; i > dt.Rows.Count;i++)
{
dt.Rows[i][11] = HttpUtility.HtmlEncode(dt.Rows[i][11]);
}
GridRec.DataSource = objview.display();
GridRec.DataBind();
}
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 2:12 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 28, 2014, 2:21 AM EDT
objview.display().rows or count.
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 2:27 AM EDT
If use objview.display().rows or count thn Im getting error like:
Error112'System.Data.DataSet' does not contain a definition for 'rows' and no extension method 'rows' accepting a first argument of type 'System.Data.DataSet' could be found (are you missing a using directive or an assembly reference? cn u help me abt diz
Khan Abrar AhmedRank #778 · 3K reputationPosted Oct 28, 2014, 2:36 AM EDT
DataSet ds = objview.display();// check here this is giveing the output proper or not
DatTable dt = ds.Table[0];
foreach (DataRow row in dt.Rows) // Loop over the rows.
{
//add the decode code here
//HttpUtility.HtmlEncode(your string)
}
DataView dtView = new DataView(dt);
GridRec.DataSource = dtView;
GridRec.DataBind();
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 2:39 AM EDT
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 2:51 AM EDT
Cannot find column 11
bt in my database tht column no is 11 only
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 2:54 AM EDT
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = objview.display();
dt = ds.Tables[0];
foreach (DataRow row in dt.Rows)
{
HttpUtility.HtmlEncode(dt.Rows[0][11]);
}
DataView dtView = new DataView(dt);
GridRec.DataSource = dtView;
GridRec.DataBind();
}
priya AvanigaddaRank #7,836 · 233 reputationPosted Oct 28, 2014, 3:03 AM EDT
its not showing any error bt Im getting the data with tags
"jobdescription" is the column name in database
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts