文本编辑框,类似于csdn使用的fckedit。具有广泛的用途。下面介绍其中之一FreeTextBox:

下载FreeTextBox:

http://freetextbox.com/files/6949/download.aspx

下载完解压。

我使用的是Framework-2.0中的FreeTextBox.dll。这个比1.0的要容易上手点,不需要配置太多。

将这个文件夹复制到项目文件的bin目录下。然后添加引用。

同时可以复制aspnet_client文件夹及内容进入你的项目文件夹中。我是直接放在根目录下的。这个的用处就是传输图形图像的使用。可以创建,删除文件夹和文件的。没有这个,你使用图像麻烦。

此时你可以参考它自带的英文说明(readme.txt):照做即可。

1 Installation of dll

2 Installing the FreeTextBox support files

上面2步,参考上面的讲解。

3 Using FreeTextBox

将下面的内容加入aspx文件的顶部:

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

加入下面的代码在<form runat="server"> 之间:

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

我的使用如下:

<FTB:FreeTextBox id="FreeTextBox1" runat="Server" AllowHtmlMode="True" ButtonFileExtention="gif,jpg" ImageGalleryPath="~/imagesLib/" 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" />

这个可以自定义的。readme里也有说明。

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

其中的参数添加在ToolbarLayout中。比较有用的红色显示。

这样你可以运行了。

界面如下:

ParagraphNormalHeading 1Heading 2Heading 3Heading 4Heading 5Heading 6FormattedAddress FontArialCourier NewGaramondGeorgiaTahomaTimesVerdana Size123456 ColorBlackGrayDarkGrayLightGrayWhiteAquamarineBlueNavyPurpleDeepPinkVioletPinkDarkGreenGreenYellowGreenYellowOrangeRedBrownBurlyWoodBeige

class="FreeTextBox1_DesignBox" id="FreeTextBox1_designEditor" style="padding: 0px; width: 598px; height: 349px;" src="about:blank">
class="FreeTextBox1_DesignBox" id="FreeTextBox1_previewPane" style="padding: 0px; width: 598px; height: 349px;" src="about:blank">
   Design  HTML

如果出现如下错误:A potentially dangerous Request.Form value was detected from the client

则需要添加代码:ValidateRequest="false"

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FreeTextBox.aspx.cs" Inherits="FreeTextBox" ValidateRequest="false" %>

注意:你可以在属性窗口中进行众多设置。自己体会一下。

比如:ImageGalleryPath设置为~/imagesLib/

下面讲解图像处理:

复制ftb.imagegallery.aspx进入项目文件夹:

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

我的代码如下:

<%@ Page Language="C#" ValidateRequest="false" Trace="false" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E) ...{
    
    // *** remove this return statement to use the following code ***
    return;

    string currentFolder = ImageGallery1.CurrentImagesFolder;
    
    // modify the directories allowed
    if (currentFolder == "~/imagesLib") ...{

        // these are the default directories FTB:ImageGallery will find
        string[] defaultDirectories = System.IO.Directory.GetDirectories(Server.MapPath(currentFolder),"*");
        
        // user defined custom directories
        string[] customDirectories = new string[] ...{"folder1","folder2"};
        
        // the gallery will use these images in this instance
        ImageGallery1.CurrentDirectories = customDirectories;
    }
    
    
    // modify the images allowed
    if (currentFolder == "~/imagesLib") ...{

        System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(Server.MapPath(currentFolder));

        // these are the default images FTB:ImageGallery will find
        System.IO.FileInfo[] defaultImages = directoryInfo.GetFiles("*");
        
        // user defined custom images (here, we're just allowing the first two)
        System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] ...{defaultImages[0], defaultImages[1]};
        
        // the gallery will use these images in this instance
        ImageGallery1.CurrentImages = customImages;
    }    
    
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Image Gallery</title>
</head>
<body>

    <form id="Form1" runat="server" enctype="multipart/form-data">  
    
        <FTB:ImageGallery id="ImageGallery1" 
            JavaScriptLocation="ExternalFile" 
            UtilityImagesLocation="ExternalFile" 
            SupportFolder="~/aspnet_client/FreeTextBox/"
            AllowImageDelete="true" AllowImageUpload="true" AllowDirectoryCreate="true" AllowDirectoryDelete="true"  runat="Server" />
        
    </form>

</body>
</html>

自己对应文件夹体会一下:

SupportFolder="~/aspnet_client/FreeTextBox/" 就是对应的你复制的aspnet_client文件夹。

currentFolder == "~/imagesLib" 就是你设定的图像存储文件夹。运行后你可以新建或删除文件夹。

AllowImageDelete="true" AllowImageUpload="true" AllowDirectoryCreate="true" AllowDirectoryDelete="true"

就是使得上述功能能够使用。

我将其<htm>修改为<html xmlns="http://www.w3.org/1999/xhtml">省得老是报错。

默认的语言设置为英文,改为中文的用对应的那个值Language="zh-CN"。

测试通过。

下面贴一个我师兄用的布局图:<FTB:FreeTextBox id="FreeTextBoxXinXiNeiRong" runat="Server" AllowHtmlMode="True" ButtonFileExtention="gif,jpg,*.*" ImageGalleryPath="~/imagesLib/" ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule,InsertImageFromGallery|Cut,Copy,Paste;Undo,Redo,Print" Height="400px" Width="550px" Language="zh-CN" />

我的添加了个表格
ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu|Bold,Italic,Underline,Strikethrough;Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage,InsertRule,InsertImageFromGallery,InsertTable|Cut,Copy,Paste;Undo,Redo,Print

FreeTextBox使用详解(FTBv3-1-6)相关推荐

  1. FreeTextBox使用详解 (版本3.1.1)

    FreeTextBox使用详解 Author: Annerose     Date:12/16/2005 版本: FreeTextBox 3.1.1  ASP.NET1.1 1.下载 FreeText ...

  2. FreeTextBox使用详解

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

  3. [转]FreeTextBox使用详解

    本文转自 http://blog.csdn.net/JOHNCOOLS/archive/2006/04/08/655553.aspx 感谢作者们的付出 --------------- 版本: Free ...

  4. 从命令行到IDE,版本管理工具Git详解(远程仓库创建+命令行讲解+IDEA集成使用)

    首先,Git已经并不只是GitHub,而是所有基于Git的平台,只要在你的电脑上面下载了Git,你就可以通过Git去管理"基于Git的平台"上的代码,常用的平台有GitHub.Gi ...

  5. JVM年轻代,老年代,永久代详解​​​​​​​

    秉承不重复造轮子的原则,查看印象笔记分享连接↓↓↓↓ 传送门:JVM年轻代,老年代,永久代详解 速读摘要 最近被问到了这个问题,解释的不是很清晰,有一些概念略微模糊,在此进行整理和记录,分享给大家.在 ...

  6. docker常用命令详解

    docker常用命令详解 本文只记录docker命令在大部分情境下的使用,如果想了解每一个选项的细节,请参考官方文档,这里只作为自己以后的备忘记录下来. 根据自己的理解,总的来说分为以下几种: Doc ...

  7. 通俗易懂word2vec详解词嵌入-深度学习

    https://blog.csdn.net/just_so_so_fnc/article/details/103304995 skip-gram 原理没看完 https://blog.csdn.net ...

  8. 深度学习优化函数详解(5)-- Nesterov accelerated gradient (NAG) 优化算法

    深度学习优化函数详解系列目录 深度学习优化函数详解(0)– 线性回归问题 深度学习优化函数详解(1)– Gradient Descent 梯度下降法 深度学习优化函数详解(2)– SGD 随机梯度下降 ...

  9. CUDA之nvidia-smi命令详解---gpu

    nvidia-smi是用来查看GPU使用情况的.我常用这个命令判断哪几块GPU空闲,但是最近的GPU使用状态让我很困惑,于是把nvidia-smi命令显示的GPU使用表中各个内容的具体含义解释一下. ...

  10. Bert代码详解(一)重点详细

    这是bert的pytorch版本(与tensorflow一样的,这个更简单些,这个看懂了,tf也能看懂),地址:https://github.com/huggingface/pytorch-pretr ...

最新文章

  1. SQLServer2000同步复制技术实现步骤(收藏)
  2. ETH网络要爆炸,未来Token的最佳选择注定是BCH
  3. python自学时间-Python 从入门到精通:一个月就够了!
  4. 好系统重装助手教您如何设置宽带并连接无线上网
  5. 网易云信安全体系全面升级,获公安部信息安全认证
  6. boost::coroutine模块实现不对称链的测试程序
  7. VB程序逆向常用的函数
  8. 把一个人的特点写具体作文_部编版五年级下册语文 第五单元:习作 | 把一个人的特点写具体 电子课本+教案课件...
  9. Linux下基于eclipse的arm开发环境的建立
  10. 搜索python题目的软件_Python编程快速上手——正则表达式查找功能案例分析
  11. [POJ 2891] Strange Way to Express Integers
  12. Active Directory系列之五:Active Directory的主要还原
  13. latex中极限符号$与$$区别
  14. easyui框架的使用,定制日历控件
  15. 2022-08-20 mysql范围查询技术专利交底书
  16. 磁盘清理 磁盘分析 磁盘空间 磁盘大小 可视化【软件】
  17. dvi接口少4针_DVI接口针脚数量,详细图文资料介绍
  18. apache2 不解析php,apache2不解析php怎么办
  19. windows7现实计算机内存不足,win7 64位有剩余空间却提示内存不足的解决方法
  20. 嵌入式智能家居项目视频监控_智能化您的视频嵌入

热门文章

  1. uboot研读笔记 | 14 - uboot启动流程分析(2016.03版本)
  2. python爬虫英文翻译_python爬虫学习---爬取微软必应翻译(中英互译)
  3. matlab低通滤波器库函数代码_MATLAB低通滤波器的设计代码
  4. AutoCAD dwg(dxf)图外有多余的点或者线解决办法
  5. mysql安装包如何使用_关于MySQL安装包如何使用的详细介绍
  6. 可视化编程语言是什么意思
  7. RegExp(正则表达式对象)
  8. svn安装以及初步使用
  9. M1芯片电脑SVN安装
  10. 4款时尚优雅宋体Logo字体(可免费商用)