FreeTextBox使用详解

版本: FreeTextBox 3.1.1  ASP.NET1.1
1.下载 FreeTextBox 3.1.1 (released 2005/11/08)

http://www.freetextbox.com/downloads.aspx

2. 安装

FreeTextBox 3.0以上版本均支持内部模式,即图片资源和javascript都集成在dll中, 本文仅探讨内部模式(Internal Resources).

1) 把FTBv3-1-1/Framework-1.1/FreetextBox.dll拷入bin目录.

2) 在项目中添加FreetextBox.dll的dll引用

3) Web.config加入如下代码

3. 使用FreeTextBox

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>

 

1) aspx页面顶上
2) 调用3)工具栏皮肤

4) 得到保存编辑的内容
5) 客户端中检测到有潜在危险的 Request.Form 值


4 图片上传


1) 工具栏上添加ImageGallery按钮.
2) 拷贝 "ftb.imagegallery.aspx" 文件到同一目录下

http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery

<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

<FTB:FreeTextBox id="FreeTextBox1" runat="Server" />

ToolbarStyleConfiguration = Offoce2003/OfficeXP/Office2000/MAC

 1 private void InitializeComponent()
 2 {   
 3     //    指向同一个委托
 4     this.FreeTextBox1.SaveClick += new System.EventHandler this.FreeTextBox1_SaveClick);
 5     this.Button1.Click += new System.EventHandler(this.FreeTextBox1_SaveClick);
 6 }
 7
 8 private void FreeTextBox1_SaveClick(object sender, System.EventArgs e)
 9 {
10     divshow.InnerHtml = FreeTextBox1.Text;
11 }

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

 

<FTB:FreeTextBox ..ToolbarLayout=" ..,InsertImageFromGallery,.. />

3) FreeTextBox 属性设置

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

4) ImageGallery 的设置
ftb.imagegallery.aspx文件里
AllowDirectoryCreate - 能否建立文件夹
AllowDirectoryDelete - 能否删除文件夹
AllowImageUpload - 能否上传图片
AllowImageDelete - 能否删除图片
AcceptedFileTypes - 可以上传文件扩展名的数组(array)

<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation="InternalResource" UtilityImagesLocation="InternalResource"
SupportFolder="~/aspnet_client/FreeTextBox/"
AllowImageDelete=true
AllowImageUpload=true
AllowDirectoryCreate=false
AllowDirectoryDelete=false
runat="Server" />


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

 以上是普遍存在的文章,以下是个人在应用中遇到的问题

1、ftb.imagegallery.aspx下载问题,http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery好像不能下载,也许是我个人网络的问题。

解决途径------------从同学那里copy了一个,如果有需要的留下email

2、ftb.imagegallery.aspx不能选择图片,拷文件夹aspnet_client到根目录下,aspnet_client里面包括FreeTextBox文件夹(主要是image and JavaScript)

3、中文问题:aspnet_client-->FreeTextBox--->languages-->zh-CN.xml(注意大小写JavaScript),确保该文件的存在后,去aspx文件找到FreeTextBox,修改Language属性为zh-CN。

最后提醒一下,不要忘记.net的缓存问题,如:修改Language后按CTRL+F5浏览不是预期的效果

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

皇家玛

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值