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???
23 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Again I changed HttpUtility.HtmlEncode("jobdescription") instead of HttpUtility.HtmlEncode(ds.Rows[0][11]) its not showing any error bt Im getting the data with tags
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();
ya I checked with breakpoint bt I'm nt getting any row.
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
Thank u fr ur hlp bt im getting diz error : 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?)E:\Projects - Net\RecruitMgr\Recruit\Recruit\ViewRequirement.aspx.cs1843Recruit
//HttpUtility.HtmlEncode(your string) //like for(i=0,i<objview.display().rows.count;i++) { //suppose your value in 1st columne try to change the loop and values then
priya AvanigaddaPosted Oct 28, 2014, 7:03 AM
its not showing any error bt Im getting the data with tags
"jobdescription" is the column name in database
priya AvanigaddaPosted Oct 28, 2014, 6:54 AM
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 AvanigaddaPosted Oct 28, 2014, 6:51 AM
Cannot find column 11
bt in my database tht column no is 11 only
priya AvanigaddaPosted Oct 28, 2014, 6:39 AM
Khan Abrar AhmedPosted Oct 28, 2014, 6:36 AM
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 AvanigaddaPosted Oct 28, 2014, 6:27 AM
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 AhmedPosted Oct 28, 2014, 6:21 AM
objview.display().rows or count.
priya AvanigaddaPosted Oct 28, 2014, 6:12 AM
Khan Abrar AhmedPosted Oct 28, 2014, 5:54 AM
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 AvanigaddaPosted Oct 28, 2014, 5:47 AM
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"
priya AvanigaddaPosted Oct 28, 2014, 5:35 AM
priya AvanigaddaPosted Oct 28, 2014, 5:02 AM
Khan Abrar AhmedPosted Oct 28, 2014, 4:42 AM
priya AvanigaddaPosted Oct 28, 2014, 3:19 AM
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:
priya AvanigaddaPosted Oct 28, 2014, 3:17 AM
Khan Abrar AhmedPosted Oct 28, 2014, 3:13 AM
priya AvanigaddaPosted Oct 28, 2014, 2:53 AM
Khan Abrar AhmedPosted Oct 28, 2014, 2:39 AM
priya AvanigaddaPosted Oct 28, 2014, 2:33 AM
Khan Abrar AhmedPosted Oct 28, 2014, 2:20 AM
HttpUtility.HtmlEncode(your string)priya AvanigaddaPosted Oct 28, 2014, 2:12 AM
priya AvanigaddaPosted Oct 28, 2014, 2:06 AM
Khan Abrar AhmedPosted Oct 28, 2014, 2:00 AM
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';