欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

FreeTextBox使用笔记

程序员文章站 2022-03-19 22:13:46
...

把FreeTextBox拖到代码中,如下

<form runat="server">
     <FTB:FreeTextBox id="FreeTextBox1"
       ToolbarLayout="........"
       runat="Server" />
</form>
设置显示的按钮 ToolbarLayout,你可以在这里 填写:
ToolbarLayout=" ParagraphMenu, FontFacesMenu, FontSizesMenu, FontForeColorsMenu,

FontBackColorsMenu, FontForeColorPicker, FontBackColorPicker| Bold, Italic, Underline,

Strikethrough, Superscript , Subscript , RemoveFormat| JustifyLeft, JustifyRight, JustifyCenter,

JustifyFull; BulletedList, NumberedList, Indent, Outdent; CreateLink, Unlink, InsertImage| Cut,

Copy, Paste, Delete, Undo, Redo, Print, Save| SymbolsMenu, StyleMenu, InsertHtmlMenu| InsertRule,

InsertDate, InsertTime| InsertTable, EditTable; InsertTableRowBefore, InsertTableRowAfter,

DeleteTableRow; InsertTableColumnBefore, InsertTableColumnAfter, DeleteTableColumn| InsertForm,

InsertDiv, InsertTextBox, InsertTextArea, InsertRadioButton, InsertCheckBox, InsertDropDownList,

InsertButton| InsertImageFromGallery, Preview, SelectAll, WordClean, EditStyle, ieSpellCheck"


这么多种按钮,中间用可以用","(逗号)";"(分号)"|"(管道符)隔开

注:“,”号会显示到一行,"|"换行

Bold    加粗
BulletedList 项目符号
Copy    复制
CreateLink    插入链接
Cut     剪切
Delete    删除
DeleteTableColumn 删除一列(En)
DeleteTableRow    删除一行(En)
IeSpellCheck IE拼写检查(En 需要安装拼写检查软件)
Indent    增加缩进
InsertDate 插入日期
InsertImage 插入图片
InsertRule 插入水平线(En)
InsertTable 插入表格(En)
InsertTableColumnAfter 插入表格列在后面(En)
InsertTableColumnBefore 插入表格列在前面(En)
InsertTableRowAfter 插入表格行在后面(En)
InsertTableRowBefore 插入表格行在前面(En)
InsertTime 插入时间
Italic 斜体
JustifyCenter 居中
JustifyFull 两端对齐
JustifyLeft 左对齐
JustifyRight 右对齐
NetSpell 网络拼写检查(En)
NumberedList 编号
Outdent 减少缩进
Paste 粘贴
Print 打印
Redo    重复
RemoveFormat 删除所有格式
Save    保存(En)
StrikeThrough    删除线
Subscript 下标
Superscript 上标
Underline 下划线
Undo    撤消
Unlink    删除链接

 

 

 

其实默认的就很好了

 

 

添加配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<httpHandlers>
<add verb="GET" path="FtbWebResource.axd" type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" />
</httpHandlers>
<system.web>
<configuration>
 

2) 客户端中检测到有潜在危险的 Request.Form 值

<%@ Page language="c#"  ValidateRequest="false"%>

 这个是防止上传图片时遇到得一些问题,一定要写

 

 

拷贝 "ftb.imagegallery.aspx" 文件到同一目录下

3) FreeTextBox 属性设置

ImageGalleryPath = "~/image/upload"    上传默认路径
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}"    ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~"

4) ImageGallery 的设置
ftb.imagegallery.aspx文件里

< 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)

四,FreeTextBox 其他的一些属性

1) 工具栏皮肤

ToolbarStyleConfiguration = Offoce2003/OfficeXP/Office2000/officeMAC

2)设置语言


FreeTextBox1.Language=zh-cn

(中文,其他得在Language文件夹里都有)

 

在使用FreeTextBox控件进行文本编辑后,进行保存时需要取编辑内容对应的HTML文本内容。取编

辑内容使用my_freetextbox.ViewStateText属性会比使用my_freetextbox.Text属性,在后续的字

符串内容处理上会方便一些。

        在所取出的字符串中,系统自动加上了“\r\n”的回车换行字符串标示,在存储内容到数据库之前最

好将这些“\r\n”字符串用空串“”替换掉(如:my_str=my_str.Replace("\r\n","")),否则在将

来调用时会导致不正常显示。

        在所取出的字符串中,系统还把编辑文本中的双引号“用转义字符\进行了处理,如原字符串为

“wangshixin said "hello!"”,所取得的字符串实际为“wangshixin said \"hello!\"”,因此需要

将所获得的字符串中的全部“\"”用特定的字符串替换掉。在将来提取显示时,再将特定字符串替换为

“\"”(如:my_str=my_str.Replace("\"","wangshixin750920"))。

 

 

 

 

相关标签: IE Web XML