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

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园_首页
GbyAI
GbyAI
罗磊的独立博客
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
U
Unit 42
V
Visual Studio Blog
F
Fortinet All Blogs
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
The Cloudflare Blog
T
Tor Project blog
Martin Fowler
Martin Fowler
K
Kaspersky official blog
Scott Helme
Scott Helme
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
DataBreaches.Net
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
美团技术团队
S
Secure Thoughts
C
Cisco Blogs
M
MIT News - Artificial intelligence
L
Lohrmann on Cybersecurity
T
Tenable Blog
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Spread Privacy
Spread Privacy
S
Security @ Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
A
Arctic Wolf
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
O
OpenAI News
V
Vulnerabilities – Threatpost

博客园 - 9who

Nopcommerce2.70版本如何在vs2010中打开 UrlRewriter 伪url的配置 - 9who - 博客园 百度,google,雅虎等搜索引擎的高级搜索语法 开发记录——触发器实现 数据库关联字段 JS函数验证总结 - 9who - 博客园 petshop4.0 各个文件的作用 如何构造一个C#语言的爬虫蜘蛛程序 ASP.NET26个常用性能优化方法 CSS基本布局16例 CSS命名规范(建议版) web布局最实用的12条css技巧 SQL2005数据库转换到SQL2000 我的几个.NET编程习惯 SQL2005示例数据库|AdventureWorks下载安装|NORTHWND下载安装|PUBS下载安装 (转)Ext与.NET超完美整合 .NET开发者的超级优势 C#与OOP之 接口 C#中面向对象的OOP概念 ASP.NET常用到的js通用函数 c#代码可以做成dll来使用 ASP.NET 脚本侵入概述
FCKEditor在.net的使用
9who · 2009-04-14 · via 博客园 - 9who

FCKeditor一款开放源码的优秀的HTML文本编辑器,它在ASP.NET下一般的安装和使用方法如下:

1、下载FckEditor 2.6.3,它主要包括核心文件。

2、下载FckEditor 2.6.3 .Net ,包括ASP.NET的DLL文件,并且解压到任意目录。

3、解压FckEditor 2.6.3 压缩包,将文件夹FCKeditor复制到网站的根目录,这里以ASP.NET 2.0的test项目为例,将其复制到test的根目录,并且在根目录下新建uploads目录用来存放编辑器上传得文件。

4、修改js配置.打开FCKeditor目录下的fckconfig.js文件,将FCKConfig.DefaultLanguage的值改为zh-cn使其的界面语言改变为简体中文,_FileBrowserLanguage和_QuickUploadLanguage的值都改为aspx。可选的修改如下,可以修改编辑器的skin,将FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' 的default可以该为office2003或者silver。保存修改,关闭文件。

5、配置web.config.
打开工程的Web. Config文件,修改appSettings元素,配置如下:

<appSettings>

<add key="FCKeditor:BasePath" value="~/FCKeditor/"/>

<add key="FCKeditor:UserFilesPath" value="/你的项目名称/uploads" />
//例如:我的解决方案名为test,那么这里就是"/test/uploads".

</appSettings>

设置了FCKeditor:BasePath后就不用再每次使用FCKeditor实例时指定BasePath属性了,FCKeditor:UserFilesPath则是制定我们所有上传的文件的所在目录。你也许会问为什么要设置成/test/uploads这样而不是~/uploads,因为FCKeditor使用这个值来返回你上传后的文件的相对路径到客户端,~/uploads的形式是ASP.NET在服务可以编译解释的,但是在客户端的静态就不懂这是什么了。如果使用~/uploads后,那么所有上传文件的返回路径都是~/uploads形式的,你就会得到这样的链接http://~/uploads/Image/logo.gif这样的链接解果就是路径为找到。所以才要我们上述那样设置,这是在开发阶段,如果在工程完成后发布时请记住把/test/uploads改成/uploads,道理不说大家也明白,开发阶段VS2005在运行项目时的URL是http://localhost/项目名称/的形式,发布后在Server上建立站点,跟路径就是http://www.abc.com/的形式了,所以发布后一定要改过来。这些地方是在使用FCKeditor2.6.3+ASP.NET2.0时经常发错误而又莫名其所云的地方。

6、在项目中引用刚才解压的FCKeditor.NET压缩包里的FredCK.FCKeditorV2.dll文件。具体位置是 FCKeditor.Net_2.6.3/bin/release/FredCK.FCKeditorV2.dll

7、注册用户控件.打开test项目的default.aspx页面,在

程序代码
<%@ Page Language="C#" MasterPageFile="~/Weblog.master" AutoEventWireup="true" CodeFile="article.aspx.cs" Inherits="article" Title="Test FckEditor" %>

下面加入以下代码

程序代码
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

然后就可以在default.aspx页面使用这个控件了:

程序代码
<fckeditorv2:fckeditor id="FCKeditor" runat="server" Width="580px" EnableXHTML="true" EnableSourceXHTML="true" basepath="~/FCKeditor/" height="500px"></fckeditorv2:fckeditor>

8、如何取得编辑器中的文本。
该控件有个属性是value,它就是获得编辑器中的文本的。

9、FCKeditor控件的属性和事件。
具有的属性列表如下:

AutoDetectLanguage
BaseHref
BasePath
ContentLangDirection
CustomConfigurationsPath
Debug
DefaultLanguage
EditorAreaCSS
EnableSourceXHTML
EnableViewState
EnableXHTML
FillEmptyBlocks
FontColors
FontFormats
FontNames
FontSizes
ForcePasteAsPlainText
ForceSimpleAmpersand
FormatIndentator
FormatOutput
FormatSource
FullPage
GeckoUseSPAN
Height
ID
ImageBrowserURL
LinkBrowserURL
PluginsPath
runat
SkinPath
StartupFocus
StylesXMLPath
TabSpaces
ToolbarCanCollapse
ToolbarSet
ToolbarStartExpanded
UseBROnCarriageReturn
Value
Visible
Width

具体的事件列表如下:

OnDataBinding
OnDisposed
OnInit
OnLoad
OnPreRender
OnUnload

FCKeditor出现"this connector is disabled Please check the"editor/filemanager/connectors/aspx/config.aspx"错误的解决办法

解决办法:

打开editor/filemanager/connectors/aspx/config.ascx修改CheckAuthentication()方法,返回true

C# code

private bool CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
//
//        return ( Session[ "IsAuthorized" ] != null && (bool)Session[ "IsAuthorized" ] == true );
//
// ... where Session[ "IsAuthorized" ] is set to "true" as soon as the
// user logs in your system.

        return true;
}

为了安全性的考虑可以在这里加入用户验证,根据用户权限,确定是否有权限上传文件.