(→Sample Code) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
=== Step 1 === | === Step 1 === | ||
− | Suppose that the editor is installed in the / | + | Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to include the "ASP Integration Module" file in the top of your page, just like this: |
− | <pre><!-- #INCLUDE file=" | + | <pre><!-- #INCLUDE file="/fckeditor/fckeditor.asp" --></pre> |
=== Step 2 === | === Step 2 === | ||
− | Now | + | Now FCKeditor is available and ready to use. Just insert the following code in your page to create an instance of the editor (usually inside a <form> tag): |
<pre><% | <pre><% | ||
− | |||
− | |||
− | |||
− | |||
Dim oFCKeditor | Dim oFCKeditor | ||
Set oFCKeditor = New FCKeditor | Set oFCKeditor = New FCKeditor | ||
− | oFCKeditor.BasePath = | + | oFCKeditor.BasePath = "/fckeditor/" |
oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." | oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." | ||
oFCKeditor.Create "FCKeditor1" | oFCKeditor.Create "FCKeditor1" | ||
%> | %> | ||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | "FCKeditor1" is the name used to post the editor data on forms. | + | In the above example, '''BasePath''' is set to the URL path to the FCKeditor installation folder. The '''Create''' method receives the "FCKeditor1" parameter, which is the name used to post the editor data on forms. |
=== Step 3 === | === Step 3 === | ||
Line 35: | Line 28: | ||
The complete sample - find the full sample in your Samples directory. | The complete sample - find the full sample in your Samples directory. | ||
− | <pre><!-- #INCLUDE file=" | + | <pre><!-- #INCLUDE file="/fckeditor/fckeditor.asp" --> |
<html> | <html> | ||
<head> | <head> | ||
Line 45: | Line 38: | ||
<% | <% | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Dim oFCKeditor | Dim oFCKeditor | ||
Set oFCKeditor = New FCKeditor | Set oFCKeditor = New FCKeditor | ||
− | oFCKeditor.BasePath = | + | oFCKeditor.BasePath = "/fckeditor/" |
oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." | oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." | ||
oFCKeditor.Create "FCKeditor1" | oFCKeditor.Create "FCKeditor1" | ||
Line 65: | Line 50: | ||
</body> | </body> | ||
</html> | </html> | ||
− | </pre> | + | </pre> |
+ | |||
== Handling the posted data == | == Handling the posted data == | ||
− | The editor instance just created will behave like a normal < | + | The editor instance just created will behave like a normal <textarea> field in a form. To retrieve its value you can do something like this: |
<pre><% | <pre><% | ||
− | Dim | + | Dim sValue |
− | + | sValue = Request.Form( "FCKeditor1" ) | |
%> | %> | ||
− | </pre> | + | </pre> |
+ | In the above example, "FCKeditor1" is the parameter passed to the '''Create''' method when creating the editor instance. | ||
+ | |||
+ | == Additional information == | ||
+ | |||
+ | * You can find some samples on how to use the editor in the "_samples/asp" directory of the distributed package. |
Latest revision as of 13:02, 9 April 2009
It is very easy to use FCKeditor in your ASP web pages. All the integration files are available in the official distributed package. Just follow these steps.
Contents
Integration step by step
Step 1
Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to include the "ASP Integration Module" file in the top of your page, just like this:
<!-- #INCLUDE file="/fckeditor/fckeditor.asp" -->
Step 2
Now FCKeditor is available and ready to use. Just insert the following code in your page to create an instance of the editor (usually inside a <form> tag):
<% Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = "/fckeditor/" oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." oFCKeditor.Create "FCKeditor1" %>
In the above example, BasePath is set to the URL path to the FCKeditor installation folder. The Create method receives the "FCKeditor1" parameter, which is the name used to post the editor data on forms.
Step 3
The editor is now ready to be used. Just open the page in your browser to see it at work.
Sample Code
The complete sample - find the full sample in your Samples directory.
<!-- #INCLUDE file="/fckeditor/fckeditor.asp" --> <html> <head> <title>FCKeditor - Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form action="sampleposteddata.asp" method="post" target="_blank"> <% Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = "/fckeditor/" oFCKeditor.Value = "<p>This is some <strong>sample text</strong>. You are using <a href=""http://www.fckeditor.net/"">FCKeditor</a>." oFCKeditor.Create "FCKeditor1" %> <br /> <input type="submit" value="Submit" /> </form> </body> </html>
Handling the posted data
The editor instance just created will behave like a normal <textarea> field in a form. To retrieve its value you can do something like this:
<% Dim sValue sValue = Request.Form( "FCKeditor1" ) %>
In the above example, "FCKeditor1" is the parameter passed to the Create method when creating the editor instance.
Additional information
- You can find some samples on how to use the editor in the "_samples/asp" directory of the distributed package.