亞當維奇

 

FckeditorIntegrationASP

Page history last edited by Anonymous 3 yrs ago

要在ASP中使用FCKEditor很簡單,所有需要使用到的檔案都已經包含在官方所發布的壓縮檔中.

現在只要照著下面的步驟做就可以了!!

 

步驟一

假設編輯器已經安裝在你的網站的/Fckeditor/這個路徑下。

而第一件要做的事就是將"ASP整合模組"的檔案包在你的程式最頂端.範例如下:

<!-- #INCLUDE file="FCKeditor/fckeditor.asp" -->

 

步驟二

現在Fckeditor已經可以引用了.

所以只要將下面的程式放在你要產生編輯器的頁面中(通常是放在<Form>裡面):

<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Create "FCKeditor1"
%>

FCKeditor1是表單(FORM)中的物件名稱.

 

步驟三

現在編輯器已經可以使用了!!只要使用瀏覽器開啟它就可以了!

 

完整範例

 

<!-- #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="savedata.asp" method="post">
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "/FCKeditor/"
oFCKeditor.Create "FCKeditor1"
%>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>

 

處理傳送的資料

 

編輯器會在表單中產生一個<INPUT>物件,而他的名稱則是你在建立它的時候所設定的(在上面的範例是"FCKeditor1").

所以,要接收它的值,你可以用下面的語法來接收:

 

Dim sValue
sValue = Request.Form( "FCKeditor1" )

 

更多範例

 

你可以在官網所發布的壓縮檔中的"_samples/asp"資料夾找到如何使用的一些範例.

Comments (0)

You don't have permission to comment on this page.