qwrqwerqw...
找不到"默认数据库连接字符串在webconfig配置文件中修改"中的webcon...
有演示看一下么...
1.直接使用的方法:<br/>(1) 复制 bin 目录下的 FreeTextBox.dll 文件到你的 Web 应用程序目录中的 bin 目录或其上层的虚拟目录下的 bin 目录;<br/>(2) 复制 HelperScripts 目录下的三个文件到你的 Web 应用程序目录中或其子目录中,注意使用时要指定 HelperFilePath 属性;<br/>(3) 复制 images 目录下的 ftb 目录到你的 Web 站点根目录下的 images 目录中。<br/>默认的目录结构如下:<br/> + Web 根目录<br/> + bin 目录<br/> - FreeTextBox.dll<br/> + images 目录<br/> + ftb 目录<br/> + 你的应用程序(虚拟目录)<br/> + bin 目录<br/> - FreeTextBox.dll<br/> + images 目录(这个是你的“图片库”目录,上传的图片都在此)<br/> - ftb.colorpicker.aspx<br/> - ftb.imagegallery.aspx<br/> - ftb.inserttable.aspx<br/> - test.aspx (测试)<br/> (注:+ 表示目录,- 表示文件;上面 FreeTextBox.dll 只需要复制一个就行了;)<br/>2.或者你可以更改源代码来简化某些设置。<br/>3.官方网站:<a href="http://www.freetextbox.com" target="_blank">http://www.freetextbox.com</a><br/>中文版: <a href="http://www.51aspx.com/CV/M67HNQANDQU37" target="_blank">http://www.51aspx.com/CV/M67HNQANDQU37</a><br/>上面网页中都有一些示例程序可以参考。<br/>4.使用本软件请遵照 License Agreement 协议,使用中文版时请不要去掉译者信息。<br/>由于这几天都在钻研BBS怎么贴图片的功能,所以不经意间就发现其实freetextbox这个东东真的很好用,以前排版比如换行空格我还这样做:<div class="blockcode"><div id="code_-1"><ol><li>string content1=this.TaContent.Value.Replace("\r\n","<br><br>");<br/></li> <li>string content=content1.Replace(" ","nbsp;");<br/></li> </ol></div><em onclick="copycode($('code_-1'));">复制代码</em></div>现在这个freetextbox就厉害了,你想怎么输入就怎么输入,比如你想贴图片,文字怎么个排版都可以,自己不用去控制它了,直接把它读入数据库,然后直接用数据控件来显示就可以了,这里我做了小小的例子供自己和大家来参考一下。<br/>先讲讲这个freetextbox怎么个用法吧,把freetextbox下载下来后,就可以把它添加到工具箱里去了,这里当然添加的是freetextbox.dll,然后在设计页面usefreetextbox.aspx中,直接拽入这个控件就可以,不过还要把freetextbox的一个文件夹添加进来,这个文件夹里面又有这么两个文件夹:HelperScripts,IMAGES,HelperScript中里面有这么六个文件folder.big.gif、folder.small.gif、folder.up.gif、ftb.colorpicker.aspx、ftb.imagegallery.aspx、ftb.inserttable.aspx,前面三个就是三张图片,后面三个里面是C#、JS函数,分别是取色、上传图片、插入表格的作用,好,现在看看IMAGES里面放的是什么,其实里面分别放的是office2000、2003、xp这三个版本的一些图片,freetextbox整个的外观就是由它们来构成的了。把这个freetextbox文件夹和我们新建的usefreetextbox.aspx放在同一级目录中。 <br/>现在基本上已经设置好了,不过还有些细节问题,首先,我们要设置freetextbox的各个属性,我把它列出来:<div class="blockcode"><div id="code_0"><ol><li><FTB:FreeTextBox id="FreeTextBox1" runat="server" ToolbarType="Custom" ImageGalleryPath="images" ToolbarBackGroundImage="True" ButtonDownImage="True" ButtonPath="FreeTextBox/IMAGES/FTB/office2003/" tartMode="DesignMode" AllowHtmlMode="False" HelperFilesPath="FreeTextBox/HelperScripts///"></FTB:FreeTextBox><br/></li> </ol></div><em onclick="copycode($('code_0'));">复制代码</em></div>这里大家要特别注意ButtonPath和HelperFilesPath的设置,是不是现在就可以使用这个freetextbox了呢?还没有一个重要的细节:如果我们就这样使用的话,会报错了,如下:<br/>从客户端(FreeTextBox1="<P align=center><FON...")中检测到有潜在危险的 Request.Form 值。<br/>说明: 请求验证过程检测到有潜在危险的客户端输入值,对请求的处理已经中止。该值可能指示危及应用程序安全的尝试,如跨站点的脚本攻击。通过在 Page 指令或配置节中设置 validateRequest=false 可以禁用请求验证。但是,在这种情况下,强烈建议应用程序显式检查所有输入。<br/>原因是验证没通过,它都已经提示了,所以我们在web.Config中<system.web>下添加一个配置 <pages validateRequest="false"/> 或在本页面的html源窗口的页面配置中添加validateRequest="false,即<%@ Page validateRequest="false"%><br/>好,现在OK了,发现这个东东的使用并不难吧,又不需要写什么很难的代码,下面做个例子,我在这个例子做的是这样一件事,类似BBS中发贴功能,再显示出来。<br/>----心得-------------------------------------------------------<br/>在使用FreeTextBox控件进行文本编辑后,进行保存时需要取编辑内容对应的HTML文本内容。取编辑内容使用my_freetextbox.ViewStateText属性会比使用my_freetextbox.Text属性,在后续的字符串内容处理上会方便一些。<br/> 在所取出的字符串中,系统自动加上了“\r\n”的回车换行字符串标示,在存储内容到数据库之前最好将这些“\r\n”字符串用空串“”替换掉(如:my_str=my_str.Replace("\r\n","")),否则在将来调用时会导致不正常显示。<br/> 在所取出的字符串中,系统还把编辑文本中的双引号“用转义字符\进行了处理,如原字符串为“wangshixin said "51aspx!"”,所取得的字符串实际为“wangshixin said \"51aspx!\"”,因此需要将所获得的字符串中的全部“\"”用特定的字符串替换掉。在将来提取显示时,再将特定字符串替换为<br/>“\"”(如:my_str=my_str.Replace("\"","wangshixin750920"))。<br/>FreeTextBox1.Text 取得内容(带html标签的)<br/>FreeTextBox1.HtmlStrippedText 也是取得内容(不带Html标签的)<br/>关于WORD中过来的内容,出错解决<br/> 把从word复制的文本粘贴到freetextbox里,提交到数据库的时候会提示有危险代码,也就是单引号,这是为什么?<br/> 在Dottext里的freetextbox,同一篇word文档,提交时就没有问题。<br/>我现在找到的原因是dottext里的freetextbox在提交的时候会把危险代码重新编码,而在我的项目里的freetextbox就不会。<br/> 查看包含freetextbox控件的页面源文件,又发现license不同。<br/> 解决方法:把页面中的validateRequest指令设成false即可,或者直接改web.config:<pages validateRequest="false" buffer="true"/>
:) 。。。。。。!<br/><br/>楼主研究的够彻底 啊! <br/><br/>好好学习!
感觉freetextbox不太好。
这个控件怎么不能变行距呢,再加一个控制行距的功能就更好了
我发现生成的超级链接都是在原窗口打开的,<br/><br/>我想让它加上 target="_blank" 让它在新窗口打开,<br/><br/>请问要怎么改程序呀?谢谢大哥。
:'( 这个控件无法输入内容呀这是怎么回事
:'( 这个控件无法输入内容呀这是怎么回事
大家好!<br/>我也想用FreeTextBox,可是为什么都显示不了图片呢?<br/>路径都是“http://localhost/images/ftb/office2003/insertrule.gif”<br/>请问要怎么修改呢?<br/>谢谢大家了!
很好很强大
楼主:FreetextBox 上传图片怎么解决?自己电脑上传的图片自己看就没还好。可是局域网看就看不到了……<br /> 邮箱<a href="mailto:aiky88@139.com" target="_blank">xxx@139.com</a>
试试看,不知道好用不好用啊
怎样才能自定义插入图片页面?像是弹出文件夹的效果
IE8下能用吗
排版很难看
刚开始试用FTB2.0的时候,感觉FTB真的很神,居然可以在网页状态实现编辑过程的What you see is what you get。看完FTB的文档(其实也不是很多的东西,估计就是用个NDOC或者什么类似的工具生成的SDK文档)又仔细试做了几个程序,觉得FTB的实现思路不复杂,但十分巧妙。它通过FTB这个中间部件将客户端(浏览器)的程序(javascript代码)和后台程序(C#写的aspx等ASP.NET代码)紧密结合,从而实现了这种所见即所得的效果。<br/>FTB的结构主要有三个命名空间组成:<br/>FreeTextBoxControls,FreeTextBoxControls.Design和FreeTextBoxControls.Support。<br/> 使用得最多的是FreeTextBoxControls,基本上用到的界面部件都来自于这里,例如ToolBar上每个功能Button可以在这里找到映射,而每个Button又对应着javascrip中的一个函数功能。<br/>例如:下划线这个功能,有个Underline的类(继承于ToolbarButton)实现,而这个类实际调用客户端的一段javascript代码FTB_Underline(在FreeTextBox-ToolbarItemsSrcipt.js中)。<div class="blockcode"><div id="code_-1"><ol><li>function FTB_Underline(ftbName) { <br/></li> <li> FTB_Format(ftbName,'underline'); <br/></li> </ol></div><em onclick="copycode($('code_-1'));">复制代码</em></div>如果再深究下去,仔细跟踪下这段js的代码又可以它调用FTB_Format这段代码(在FreeTextBox-MainScript.js中)。<div class="blockcode"><div id="code_0"><ol><li> <br/></li> <li>function FTB_Format(ftbName,commandName) {<br/></li> <li> editor = FTB_GetIFrame(ftbName);<br/></li> <li> if (FTB_IsHtmlMode(ftbName)) return;<br/></li> <li> editor.focus();<br/></li> <li> editor.document.execCommand(commandName,'',null);<br/></li> <li>}<br/></li> </ol></div><em onclick="copycode($('code_0'));">复制代码</em></div>它正是通过document的execCommand方法来实现效果的,查MSDN文挡可以发现它对应执行的正是Underline的命令参数。<br/>execCommand可以执行的命令参数:<div class="blockcode"><div id="code_1"><ol><li> <br/></li> <li>Command Identifiers<br/></li> <li>2D-Position<br/></li> <li>Allows absolutely positioned elements to be moved by dragging.<br/></li> <li>AbsolutePosition<br/></li> <li>Sets an element's position property to "absolute."<br/></li> <li>BackColor<br/></li> <li>Sets or retrieves the background color of the current selection.<br/></li> <li>BlockDirLTR<br/></li> <li>Not currently supported.<br/></li> <li>BlockDirRTL<br/></li> <li>Not currently supported.<br/></li> <li>Bold<br/></li> <li>Toggles the current selection between bold and nonbold.<br/></li> <li>BrowseMode<br/></li> <li>Not currently supported.<br/></li> <li>ClearAuthenticationCache<br/></li> <li>Clears all authentication credentials from the cache. Applies only to execCommand.<br/></li> <li>Copy<br/></li> <li>Copies the current selection to the clipboard.<br/></li> <li>CreateBookmark<br/></li> <li>Creates a bookmark anchor or retrieves the name of a bookmark anchor for the current selection or insertion point.<br/></li> <li>CreateLink<br/></li> <li>Inserts a hyperlink on the current selection, or displays a dialog box enabling the user to specify a URL to insert as a hyperlink on the current selection.<br/></li> <li>Cut<br/></li> <li>Copies the current selection to the clipboard and then deletes it.<br/></li> <li>Delete<br/></li> <li>Deletes the current selection.<br/></li> <li>DirLTR<br/></li> <li>Not currently supported.<br/></li> <li>DirRTL<br/></li> <li>Not currently supported.<br/></li> <li>EditMode<br/></li> <li>Not currently supported.<br/></li> <li>FontName<br/></li> <li>Sets or retrieves the font for the current selection.<br/></li> <li>FontSize<br/></li> <li>Sets or retrieves the font size for the current selection.<br/></li> <li>ForeColor<br/></li> <li>Sets or retrieves the foreground (text) color of the current selection.<br/></li> <li>FormatBlock<br/></li> <li>Sets the current block format tag.<br/></li> <li>Indent<br/></li> <li>Increases the indent of the selected text by one indentation increment.<br/></li> <li>InlineDirLTR<br/></li> <li>Not currently supported.<br/></li> <li>InlineDirRTL<br/></li> <li>Not currently supported.<br/></li> <li>InsertButton<br/></li> <li>Overwrites a button control on the text selection.<br/></li> <li>InsertFieldset<br/></li> <li>Overwrites a box on the text selection.<br/></li> <li>InsertHorizontalRule<br/></li> <li>Overwrites a horizontal line on the text selection.<br/></li> <li>InsertIFrame<br/></li> <li>Overwrites an inline frame on the text selection.<br/></li> <li>InsertImage<br/></li> <li>Overwrites an image on the text selection.<br/></li> <li>InsertInputButton<br/></li> <li>Overwrites a button control on the text selection.<br/></li> <li>InsertInputCheckbox<br/></li> <li>Overwrites a check box control on the text selection.<br/></li> <li>InsertInputFileUpload<br/></li> <li>Overwrites a file upload control on the text selection.<br/></li> <li>InsertInputHidden<br/></li> <li>Inserts a hidden control on the text selection.<br/></li> <li>InsertInputImage<br/></li> <li>Overwrites an image control on the text selection.<br/></li> <li>InsertInputPassword<br/></li> <li>Overwrites a password control on the text selection.<br/></li> <li>InsertInputRadio<br/></li> <li>Overwrites a radio control on the text selection.<br/></li> <li>InsertInputReset<br/></li> <li>Overwrites a reset control on the text selection.<br/></li> <li>InsertInputSubmit<br/></li> <li>Overwrites a submit control on the text selection.<br/></li> <li>InsertInputText<br/></li> <li>Overwrites a text control on the text selection.<br/></li> <li>InsertMarquee<br/></li> <li>Overwrites an empty marquee on the text selection.<br/></li> <li>InsertOrderedList<br/></li> <li>Toggles the text selection between an ordered list and a normal format block.<br/></li> <li>InsertParagraph<br/></li> <li>Overwrites a line break on the text selection.<br/></li> <li>InsertSelectDropdown<br/></li> <li>Overwrites a drop-down selection control on the text selection.<br/></li> <li>InsertSelectListbox<br/></li> <li>Overwrites a list box selection control on the text selection.<br/></li> <li>InsertTextArea<br/></li> <li>Overwrites a multiline text input control on the text selection.<br/></li> <li>InsertUnorderedList<br/></li> <li>Toggles the text selection between an ordered list and a normal format block.<br/></li> <li>Italic<br/></li> <li>Toggles the current selection between italic and nonitalic.<br/></li> <li>JustifyCenter<br/></li> <li>Centers the format block in which the current selection is located.<br/></li> <li>JustifyFull<br/></li> <li>Not currently supported.<br/></li> <li>JustifyLeft<br/></li> <li>Left-justifies the format block in which the current selection is located.<br/></li> <li>JustifyNone<br/></li> <li>Not currently supported.<br/></li> <li>JustifyRight<br/></li> <li>Right-justifies the format block in which the current selection is located.<br/></li> <li>LiveResize<br/></li> <li>Causes the MSHTML Editor to update an element's appearance continuously during a resizing or moving operation, rather than updating only at the completion of the move or resize.<br/></li> <li>MultipleSelection<br/></li> <li>Allows for the selection of more than one site selectable element at a time when the user holds down the SHIFT or CTRL keys.<br/></li> <li>Open<br/></li> <li>Not currently supported.<br/></li> <li>Outdent<br/></li> <li>Decreases by one increment the indentation of the format block in which the current selection is located.<br/></li> <li>OverWrite<br/></li> <li>Toggles the text-entry mode between insert and overwrite.<br/></li> <li>Paste<br/></li> <li>Overwrites the contents of the clipboard on the current selection.<br/></li> <li>PlayImage<br/></li> <li>Not currently supported.<br/></li> <li>Print<br/></li> <li>Opens the print dialog box so the user can print the current page.<br/></li> <li>Redo<br/></li> <li>Not currently supported.<br/></li> <li>Refresh<br/></li> <li>Refreshes the current document.<br/></li> <li>RemoveFormat<br/></li> <li>Removes the formatting tags from the current selection.<br/></li> <li>RemoveParaFormat<br/></li> <li>Not currently supported.<br/></li> <li>SaveAs<br/></li> <li>Saves the current Web page to a file.<br/></li> <li>SelectAll<br/></li> <li>Selects the entire document.<br/></li> <li>SizeToControl<br/></li> <li>Not currently supported.<br/></li> <li>SizeToControlHeight<br/></li> <li>Not currently supported.<br/></li> <li>SizeToControlWidth<br/></li> <li>Not currently supported.<br/></li> <li>Stop<br/></li> <li>Not currently supported.<br/></li> <li>StopImage<br/></li> <li>Not currently supported.<br/></li> <li>StrikeThrough<br/></li> <li>Not currently supported.<br/></li> <li>Subscript<br/></li> <li>Not currently supported.<br/></li> <li>Superscript<br/></li> <li>Not currently supported.<br/></li> <li>UnBookmark<br/></li> <li>Removes any bookmark from the current selection.<br/></li> <li>Underline<br/></li> <li>Toggles the current selection between underlined and not underlined.<br/></li> <li>Undo<br/></li> <li>Not currently supported.<br/></li> <li>Unlink<br/></li> <li>Removes any hyperlink from the current selection.<br/></li> <li>Unselect<br/></li> <li>Clears the current selection.<br/></li> </ol></div><em onclick="copycode($('code_1'));">复制代码</em></div>基本上每个命令参数都可以在FTB的FreeTextBoxControls中找到对应的实现类,如果觉得有些没有实现,自己参照已经实现的功能来增加也十分简单和方便。<br/> FTB还提供了公开的接口,例如继承于ToolbarButton可以实现对应的工具按钮,继承于ToolbarDropDownList则实现下拉式选择(如选择字体那种),对应javascript的方法只须传递对应的方法名字符串给类即可,自己写的javascript可以放在js中,也可以放在ScriptBlock的字符串参数里面,前者前端查看源码看不到,后者则将整个函数源码传回,一切都十分公开和方便。<br/> 这种思路是否也和ASP.NET的思路类似?<br/> 由于javascript可以被多种浏览器支持(估计有些小兼容问题,可以通过javascript来兼容),因此FTB可以在多种环境下正常工作。现在用的这个blog系统(.Text)也用了FTB,但版本是1.6.3.26037(汉化版),有兴趣可以在发表文章的地方查看网页源代码看看,就会发现好多的FTB_XXX的javascript函数。这些在2.0已经全部集中放到FreeTextBox-ToolbarItemsSrcipt.js和FreeTextBox-MainScript.js中了,应该说这样比较归一些。51aspx.com<br/> 如果担心FTB的免费协议对商业用途有些影响的话,自己根据这个思路来开发一个适合自己产品用的所见即所得编辑器控件应该也不是难事。
[img][url]<table style="width: auto;"><tr><td style="border:none;"><div class="quote"><blockquote><div class="blockcode"><div id="code_-1"><ol><li>:D<br/></li> </ol></div><em onclick="copycode($('code_-1'));">复制代码</em></div></blockquote></div></td></tr></table>[/url][/img]
开发环境: VS2003 | 开发语言:C#<br/><img src="http://www.51aspx.com/codeImg/100A.jpg" border="0" onload="thumbImg(this)" /> <img src="http://www.51aspx.com/codeImg/100B.jpg" border="0" onload="thumbImg(this)" /><br/><br/><br/>标签: <a href="http://www.51aspx.com/Tags/5" target="_blank">C#.net</a> - <a href="http://www.51aspx.com/Tags/6" target="_blank">开源</a> - <a href="http://www.51aspx.com/Tags/7" target="_blank">源码</a> - <a href="http://www.51aspx.com/Tags/10" target="_blank">经典代码</a> - <br/><br/><br/><br/>FreeTextBox 是一个基于 Internet Explorer 中 MSHTML 技术的 ASP.NET 服务器控件。这是一款优秀的自由软件(Free Software),我们可以轻松地将其嵌入到 Web Forms 中实现 HTML 内容的在线编辑,在新闻发布、博客写作、论坛社区等多种 Web 系统中都会有用途,FTB_1.6.3_zh_Source是源码文件夹。该版本可以在Asp.net2.0中使用,详见代码佩文 <br/><br/>下载地址:<a href="http://www.51aspx.com/CV/M67HNQANDQU37/" target="_blank">http://www.51aspx.com/CV/M67HNQANDQU37/</a>
