【转】freetextbox的ToolBarLayout属性设置

相关总结可看我另一篇: http://blog.csdn.net/goodshot/article/details/8271866
 
 
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,InsertImageFromGallery
 
 
 

三,图片上传
1) 工具栏上添加ImageGallery按钮.

< FTB:FreeTextBox  id="FreeTextBox1"    runat="Server" OnSaveClick="FreeTextBox1_SaveClick" ToolbarLayout =InsertImageFromGallery />

(ToolbarLayout属性有很多值可以赋予,若只写InsertImageFromGallery,那么只会出现一个上传图片的按钮,其他的就不会显示.网上查到了另外一些供大家参考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    删除链接

2) 拷贝 "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"))。

 

freetextbox:图片路径是完全路径,例如:http://localhost/testFTB/images/test.jpg

不好的地方就是,在图片名称完全相同的情况下是覆盖原有文件的

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值