惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - choice

用Adobe Flex3开发AIR应用程序–入门指南 dhtml笔记-body对象 PureMVC 相关 flash与后台数据交换方法整理4-XMLSocket篇-转载 mssql随即取数据库中的数据 Flex范例下载地址 如何更改IE查看源代码的默认打开的编辑,比如EditPlus 2、UltraEdit等 Macromedia Flex 教程: Flex入门 (1) nvarchar与varchar的区别 C# 中 for和foreach 性能比较,提高编程性能 C#开发网站如何提高性能 - choice - 博客园 C# FAQ: const和static readonly有什么区别? Asp.Net缓存Cache使用 - choice - 博客园 asp.net程序性能优化的七个方面 (转) Flex相关 Flex2 & Flex3资料大全 GridView 几种使用方法(转) JS脚本defer的作用 - choice - 博客园 xp设置文件夹权限
FreeTextBox使用详解 (版本3.1.1) (转)
choice · 2007-07-31 · via 博客园 - choice

http://astate.cnblogs.com/archive/2005/12/16/annerose.html

FreeTextBox使用详解

Author: Annerose     Date:12/16/2005


版本: 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加入如下代码

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>


3. 使用FreeTextBox

1) aspx页面顶上

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


2) 调用

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

3)工具栏皮肤

ToolbarStyleConfiguration = Offoce2003/OfficeXP/Office2000/MAC


4) 得到保存编辑的内容

 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 }

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

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


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

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

2) 拷贝 "ftb.imagegallery.aspx" 文件到同一目录下 http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.ImageGallery

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)

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

That's all. Thanks

Annerose

12/26/2005

=======================
By the way. My first post:

http://blog.hexun.com/annerose/1779631/viewarticle.html