fckeditor 保存到数据库中是HTML源码,如何取出文本显示 例如数据库中字符串 是空格的意思,我想取出再文本框中,但是也显示 我想让他显示空格,怎么转换? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function SetContents(codeStr){ var oEditor = FCKeditorAPI.GetInstance("content") ; oEditor.SetHTML(codeStr) ;} Server.HtmlEncode("你的内容字符串")orcontent.Replace(" ","&nbsp;") 正则替换html 标签string s=Regex.Replace(FCKeditor1.Value, " <[^>]*>", ""); 用span或div显示,或文本框得用HTML编辑器Server.HtmlDecode(str); 咱搞IT 的人真是多,这么晚了,每人睡。到底是server.htmlEncode还是decode 我的方向是html源码 -----〉 文本中正常显示 如果直接显示在DIV或普通控件中,不用处理如果要在文本框中显示,必须进行html的解码. 用Server.htmlEncode了,但是报错{System.Data.SqlClient.SqlException: 在此上下文中不允许使用名称 "amp"。有效表达式包括常量、常量表达式和变量(在某些上下文中)。不允许使用列名。sql:语句是:insert into t_news(hdp,slt,title,neirong,lid,author,address) values('','<p><img height="326" width="652" alt="" src="/UploadFiles/image/fy.jpg" /></p>','asp.net 分页实现','<div><div style="font-size: 14px; line-height: 1.5em"><p align="left">先看效果</p><p align="center"><img src="http://www.hdbaixing.com/ewebeditor/UploadFile/201015172634394.jpg" border="0" alt="" /></p><p align="left">&nbsp;</p><p align="left">&nbsp;</p><p align="left">涉及3个文件,一个数据库连接类DbUtil,一个分页类PageUtil,还有一个实例cs文件,用起来相当省心</p><p align="left"><span style="color: #888888" mce_style="color: #888888;"><strong><span style="color: #000000" mce_style="color: #000000;">DbUtil.cs</span></strong></span></p><p align="left">using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br />using System.Data.SqlClient;<br />using tour.exception;</p><p align="left">namespace tour.db<br />{<br />&nbsp;&nbsp;&nbsp; ////抛出TourException异常,上一层未捕捉处理异常,待处理<br /> 直接取值就行了,lable1.value=dr["字段"].tostring();这样就行 直接保存到 <asp:Literal ID="Literal1" runat="server"></asp:Literal>控件 String.prototype.translate = function (){ var d = document.createElement("DIV"); d.appendChild(document.createTextNode(this)); return d.innerHTML.replace(/\r\n/g, '<br>').replace(/ /g, ' ').replace(/\t/g," "); } Server.HtmlEncode("你的内容字符串")或直接保存到 <asp:Literal ID="Literal1" runat="server"> </asp:Literal>控件 为什么不用Label控件???或者:Server.HtmlDecode("你的内容字符串") 或者:正则string s=Regex.Replace("你的内容字符串", " <[^>]*>", ""); Encode是编码,Decode是解码。。对#1楼的感兴趣,是前台js吧。这个api在ckeditor(fckeditor 3.0以后的版本)能用吗? server.htmlencode()只是替换<>标记,<>标记里的内容还保留的,不知道楼主要的是不是这种效果要想完全过滤html元素应该写正则过滤,用#4楼吴大哥的方法 用DIV divShow.innerHTML=srt 写的时候用的FCK 读的时候还用FCK不久完了 ckeditor怎样更改皮肤?改不了啊 企业库entlib不能缓存泛型? 简单问题加到300分求助 百度贴吧回复页中是如何实现分页功能的 谁要是有,帮帮忙,救命用的,我给100分 高分求救! 谁有基于asp.net(c#版)的聊天室源代码或文档 (50分全给) 想学习,苦于买不起VS.NET的D版盘怎么办?? js问题 怎么快速提取一个基金标题中的基金名称的关键字 , 就是一句话中的关键词语? GZipStream 中 报一个“GZip 头中的幻数不正确。请确保正在传入 GZip 流"这样的错误 HttpFileCollection如何获取指定区域的文件
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.SetHTML(codeStr) ;
}
string s=Regex.Replace(FCKeditor1.Value, " <[^>]*>", "");
Server.HtmlDecode(str);
我的方向是html源码 -----〉 文本中正常显示
如果要在文本框中显示,必须进行html的解码.
{System.Data.SqlClient.SqlException: 在此上下文中不允许使用名称 "amp"。有效表达式包括常量、常量表达式和变量(在某些上下文中)。不允许使用列名。
sql:语句是:insert into t_news(hdp,slt,title,neirong,lid,author,address) values('','<p><img height="326" width="652" alt="" src="/UploadFiles/image/fy.jpg" /></p>','asp.net 分页实现','<div>
<div style="font-size: 14px; line-height: 1.5em">
<p align="left">先看效果</p>
<p align="center"><img src="http://www.hdbaixing.com/ewebeditor/UploadFile/201015172634394.jpg" border="0" alt="" /></p>
<p align="left">&nbsp;</p>
<p align="left">&nbsp;</p>
<p align="left">涉及3个文件,一个数据库连接类DbUtil,一个分页类PageUtil,还有一个实例cs文件,用起来相当省心</p>
<p align="left"><span style="color: #888888" mce_style="color: #888888;"><strong><span style="color: #000000" mce_style="color: #000000;">DbUtil.cs</span></strong></span></p>
<p align="left">using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
using tour.exception;</p>
<p align="left">namespace tour.db<br />
{<br />
&nbsp;&nbsp;&nbsp; ////抛出TourException异常,上一层未捕捉处理异常,待处理<br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal>控件
var d = document.createElement("DIV");
d.appendChild(document.createTextNode(this));
return d.innerHTML.replace(/\r\n/g, '<br>').replace(/ /g, ' ').replace(/\t/g," ");
}
<asp:Literal ID="Literal1" runat="server"> </asp:Literal>控件
Server.HtmlDecode("你的内容字符串") 或者:
正则string s=Regex.Replace("你的内容字符串", " <[^>]*>", "");
对#1楼的感兴趣,是前台js吧。这个api在ckeditor(fckeditor 3.0以后的版本)能用吗?