FreeTextBox配置讲解(修复了一些错误)
1.添加Bin文件夹。
2.将FreeTextBox.dll放到Bin文件夹
3. 在Web.config里加入如下代码
1 <?xml version="1.0" encoding="utf-8" ?> 2 <configuration> 3 <system.web> 4 <httpHandlers> 5 <add verb="GET" path="FtbWebResource.axd" type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" /> 6 </httpHandlers> 7 <system.web> 8 <configuration>
4.在使用页面顶部添加
<%@ Register TagPrefix= "FTB" Namespace= "FreeTextBoxControls" Assembly= "FreeTextBox" %> |
5.调用FreeTextBox
<FTB:FreeTextBox id= "FreeTextBox1" runat= "Server" /> |
6.FreeTextBox配置
1)工具栏皮肤
ToolbarStyleConfiguration = Offoce2003/OfficeXP/Office2000/MAC |
2)得到保存编辑的内容//木有用到
1 2 3 4 5 6 7 8 9 10 | private voidInitializeComponent() { // 指向同一个委托 this .FreeTextBox1.SaveClick += new System.EventHandler (athis.FreeTextBox1_SaveClick); this .Button1.Click += new System.EventHandler( this .FreeTextBox1_SaveClick); } private void FreeTextBox1_SaveClick(objectsender, System.EventArgs e) { divshow.InnerHtml =FreeTextBox1.Text; } |
3)客户端中检测有危险值
<%@ Page language= "c#" ValidateRequest= "false" %> |
4)工具栏设置
ToolbarLayout属性值:

ParagraphMenu, FontFacesMenu, FontSizesMenu, FontForeColorsMenu, FontForeColorPicker, FontBackColorsMenu, FontBackColorPicker, Bold, Italic, Underline, Strikethrough, Superscript, Subscript, InsertImageFromGallery, CreateLink, Unlink, RemoveFormat, JustifyLeft, JustifyRight, JustifyCenter, JustifyFull, BulletedList, NumberedList, Indent, Outdent, Cut, Copy, Paste, Delete, Undo, Redo, Print, Save, ieSpellCheck, StyleMenu, SymbolsMenu, InsertHtmlMenu, InsertRule, InsertDate, InsertTime, WordClean, InsertImage, InsertTable, EditTable, InsertTableRowBefore, InsertTableRowAfter, DeleteTableRow, InsertTableColumnBefore, InsertTableColumnAfter, DeleteTableColumn, InsertForm, InsertForm, InsertTextBox, InsertTextArea, InsertRadioButton, InsertCheckBox, InsertDropDownList, InsertButton, InsertDiv, InsertImageFromGallery, Preview, SelectAll, EditStyle
这么多种按钮,中间用可以用","(逗号)";"(分号)"|"(管道符)隔开。
7.图片上传设置
1) 工具栏上添加ImageGallery按钮.
<FTB:FreeTextBox ..ToolbarLayout=" ..,InsertImageFromGallery,.. /> |
2) 拷贝 "ftb.imagegallery.aspx" 文件和aspnet_client文件夹(为毛木人告诉我?)到同一目录下
http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery
图片默认是上传在根目录的images文件夹里面的,所以要建一个文件夹。图片上传的原大小,调用时可设置显示大小。
3) FreeTextBox 属性设置
ImageGalleryPath = "~/image/upload" 上传默认路径
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}" ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~"
4) ImageGallery 的设置//文件里有这段代码
ftb.imagegallery.aspx文件里
1 2 3 4 5 6 7 8 | <FTB:ImageGallery id= "ImageGallery1" JavaScriptLocation= "InternalResource" UtilityImagesLocation= "InternalResource" SupportFolder= "~/aspnet_client/FreeTextBox/" AllowImageDelete= true AllowImageUpload= true AllowDirectoryCreate= false AllowDirectoryDelete= false runat= "Server" /> |
AllowDirectoryCreate - 能否建立文件夹
AllowDirectoryDelete - 能否删除文件夹
AllowImageUpload - 能否上传图片
AllowImageDelete - 能否删除图片
AcceptedFileTypes - 可以上传文件扩展名的数组(array)
5) ftb.imagegallery.aspx页面关闭//可选
打开 aspnet_client\FreeTextBox\FTB-ImageGallery.js 文件,在FTB_InsertImage函数的最后加上window.close()。
Q Q: 121866673
来源: http://zxlovenet.cnblogs.com
声明: 本文原创发表于博客园,作者为初行本文欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则视为侵权。
消息:此博客已停止更新,想了解最新博客更新请关注我的新博客 Noogel's notes
推荐: 推荐使用为知笔记(WizNote),它是电脑、手机、平板上都能用的云笔记软件,还可以分类管理和共享资料,使用我的邀请码注册:https://note.wiz.cn/i/06102d9e
打赏: 如果您觉得文章对您的工作有帮助,请小额打赏我一些,鼓励我写出更好的文章!

微信打赏

支付宝打赏
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述