FreeTextBox(版本3.1.6)在ASP.Net 2.0中使用简介

对于FreeTextBox(版本3.1.6)在ASP.Net 2.0中使用,只需要2个文件:FreeTextBox.DLL和ftb.imagegallery.aspx


就是先把FreeTextBox.DLL考到你网站的目录的Bin文件夹中

再把ftb.imagegallery.aspx考到你的网站目录下,我个人常把它放在和主页同一目录下的。不然考到其它地方,还要另外设置路径的。

打开ASP.Net2.0项目,添加引用网站目录Bin下的FreeTextBox.DLL。(如果添加过以前版本的FreeTextBox,先删除以前版本的引用)

将FreeTextBox添加到工具栏。(工具栏〉常规〉选择项〉浏览到DLL文件,添加)

可以将工具栏上的控件拖入到你的页面了
     
<FTB:FreeTextBox ID="Free1"     ImageGalleryPath="~/ImageAdmin"  
          runat="server" Text='<%# Bind("Contents") %>'
          ButtonDownImage="True"
          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>

修改ImageGalleryPath属性为你上传图片时的图片放置目录,用默认的设置时,记得要建立相应的文件夹(ImageAdmin)哦。

Q&A
Q:怎么不能新建目录,上传文件等?
A:修改ftb.imagegallery.aspx页面可以做到
            
<FTB:ImageGallery id="ImageGallery1"
              SupportFolder="~/aspnet_client/FreeTextBox/"
              AllowImageDelete="true" AllowImageUpload="true"
               AllowDirectoryCreate="true" AllowDirectoryDelete="true" runat="Server" />

!!!!注意:要去掉上面的JavaScriptLocation="ExternalFile"
   UtilityImagesLocation="ExternalFile"
           这两个属性.不然不能使用哦!

          修改AllowImageDelete等属性

Q:怎么没有看到“从图片库插入图片”这个图标?
A:修改<FTB:FreeTextBox />的ToolbarLayout属性,添加一个InsertImageFromGallery  加在最后,记得和别的属性要用","号来隔开哦

Q:按钮怎么是英文提示?
A:<FTB:FreeTextBox />有个属性叫做Language,把默认的en-US改称zh-CN吧,就是中文简体了,听说这个版本带了25种语言呢。

 


FreeTextBox 属性设置

ImageGalleryPath = "~/image/upload"  图片上传默认路径,使用默认时,要自己建立相应的文件夹哦
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}"  ftb.imagegallery.aspx的目录, 只能用相对目录,不可以用"~",这个如果你把ftb.imagegallery.aspx考贝到网站主目录(和主页同一目录)时,就使用它的默认值就可以了。

 

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)

为开发者提供的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.

建议: 删掉Page_Load事件可以显著回避上传图片不能即时显示的问题. 不要重写Page_Load

 

以上是基本设置,以下是我个人使用的经验:

在Web.Config文件中,做如下设置:


<configuration>  
     <system.web>  
         <pages   validateRequest="false"   />

<httpHandlers>
<add verb="GET"
path="FtbWebResource.axd"
type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" />
</httpHandlers>
</system.web>
</configuration>

 


目前我发现该控件不能写入“--”的符号,否则出错,有时书名号也不行。

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值