Integration"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

(Undo revision 3174 by Wiktor (Talk))
Line 1: Line 1:
 
__TOC__
 
__TOC__
 
{{CKFinder_2.x Integration Introduction|language=ASP.NET|ext=aspx}}
 
{{CKFinder_2.x Integration Introduction|language=ASP.NET|ext=aspx}}
 
 
=== Example ===
 
=== Example ===
To launch CKFinder, basically we need to do two things:
+
To start CKFinder using the JavaScript integration method, basically we need to do three things:
* Register an Assembly.
+
* Create an instance of a CKFinder class.
* Add the CKFinder tag.
+
* Assign CKFinder properties.
 +
* Call the '''Create''' method.
  
==== Step1: Register an Assembly ====
+
{{CKFinder_2.x Integration Javascript Example}}
Register an Assembly at the top of your ASP.NET source page:
 
<source lang=aspnet>
 
<%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %>
 
</source>
 
  
Add the CKFinder tag inside the <body> element:
+
The example of creating CKFinder in the ASP.NET page:
 
<pre>
 
<pre>
 
<CKFinder:FileBrowser ID="FileBrowser1" BasePath="/ckfinder/" Width="800" runat="server"></CKFinder:FileBrowser>
 
<CKFinder:FileBrowser ID="FileBrowser1" BasePath="/ckfinder/" Width="800" runat="server"></CKFinder:FileBrowser>
 
</pre>
 
</pre>
  
For a full working examples please refer to the "'''_samples'''" directory. Note that you must copy the CKFinder.dll file to your "bin" directory or make a reference to it in your Visual Studio project.
+
For a full working examples please refer to the "'''_samples'''" directory. Note that in case of javascript integration, it is required to include the integration file (ckfinder.js) to have access to the CKFinder class. In case of ASP.NET integration, you must copy the CKFinder.dll file to your "bin" directory or make a reference to it in your Visual Studio project.
  
 
== Integration methods ==
 
== Integration methods ==

Revision as of 11:23, 18 May 2010

Introduction

Before reading this section, please read the installation and configuration instructions and make sure that the examples located in the _samples directory are working correctly.

The _samples directory contains HTML files with examples of launching CKFinder by using the JavaScript code as well as a aspx folder with examples of launching CKFinder by using the ASP.NET language.

The following files are used when either the JavaScript or the ASP.NET method of launching CKFinder is used:

  • ckfinder.js in case of the JavaScript integration method,
  • ckfinder_v1.js in case of JavaScript V1 integration method (useful when migrating from CKFinder 1.x),

Example

To start CKFinder using the JavaScript integration method, basically we need to do three things:

  • Create an instance of a CKFinder class.
  • Assign CKFinder properties.
  • Call the Create method.

The example of creating CKFinder using a javascript object:

<script type="text/javascript">
var finder = new CKFinder();
finder.basePath = '/ckfinder/';
finder.create();
</script>

The example of creating CKFinder in the ASP.NET page:

<CKFinder:FileBrowser ID="FileBrowser1" BasePath="/ckfinder/" Width="800" runat="server"></CKFinder:FileBrowser>

For a full working examples please refer to the "_samples" directory. Note that in case of javascript integration, it is required to include the integration file (ckfinder.js) to have access to the CKFinder class. In case of ASP.NET integration, you must copy the CKFinder.dll file to your "bin" directory or make a reference to it in your Visual Studio project.

Integration methods

  • JavaScript integration - The preferred method of integration, simple, yet powerful.
  • JavaScript integration (V1) - The old "V1" way, useful when migrating from CKFinder 1.x because it is possible to reuse the old code.
  • ASP.NET integration - If you haven't worked with JavaScript before or the JavaScript integration seems to be too complicated then it might be the way to go for you.