百度百科FreeTextBox简介
FreeTextBox官网
下载FreeTextBox.dll
在Microsoft Visual Studio 2010 添加FreeTexBox控件到工具箱
步骤:
工具-->选择工具箱项-->浏览-->找到FreeTextBox.dll-->打开-->确定
这时工具箱就会出现FreeTextBox这个控件,拖拽一个FreeTextBox控件,运行一下会报错
未能映射路径“/aspnet_client/FreeTextBox/Languages/en-US.xml”
解决办法如下:
<FTB:FreeTextBox ID="Free1" ImageGalleryPath="~/Files" Language="zh-CN" runat="server" ButtonDownImage="True" SupportFolder="~/aspnet_client/FreeTextBox/" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertImageFromGallery,InsertRule|Cut,Copy,Paste;Undo,Redo,Print">
</FTB:FreeTextBox>
其中SupportFolder="~/aspnet_client/FreeTextBox/" 这个是关键,否则会出现未能映射路径“/aspnet_client/FreeTextBox/Languages/en-US.xml” 这个错误。启动页面运行正常.
FreeTextBox 属性设置
ImageGalleryPath = "~/Files" 上传默认路径
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}" ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~"
AllowDirectoryCreate - 能否建立文件夹
AllowDirectoryDelete - 能否删除文件夹
AllowImageUpload - 能否上传图片
AllowImageDelete - 能否删除图片
AcceptedFileTypes - 可以上传文件扩展名的数组(array)
为开发者提供的2个属性
CurrentDirectories - a string[] array of directories to allow the user to navigate toward
CurrentImages - a FileInfo[] array of files the user should be able to insert.