By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,457 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,457 IT Pros & Developers. It's quick & easy.

FCKEditor and ASP.NET

P: n/a
Has anyone had any success using ASP.NET with FCKEditor?
Mar 7 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Quite a few people have. If you are looking for a Rich Text Box
editor, check out this blog post and associated comments for a list of
great RTB controls (some pay, some free).

http://scottonwriting.net/sowblog/posts/4252.aspx

HTH,
Darren Kopp
http://blog.secudocs.com/

Mar 7 '06 #2

P: n/a

Well, I didn't have much success using the library file he supplied for it.
But I manged to get it working anyway. While scanning through a number of
documents and discussion boards on FCKEditor and ASP.NET I made three
discoveries:

1) The editor had a function that can convert an HTML Text Area into an
HTML I-Frame object and, subsequently, use it as an HTML editor.

2) Multi-line TextBox objects (ASPX) appear as HTML Text Areas on the
client side that have the same object or ID reference.

3) I can register client-side script with the "behind code" for each ASPX
page.

So, to make it all work I:

A) Copied the "FCKEditor" folder into the folder of the web application.

B) Created a multi-line textbox in my ASPX page ("txtBox1" in this case)

C) Registered the following client-side scripts within my VB code:

Private Sub ClientScriptFCKJSLib()
'Register _JavaScript block for centering panel objects on the screen
Dim JavaScriptCode as String = "

RegisterClientScriptBlock("FCKJSLib", JavaScriptCode)
End Sub

Private Sub ClientScriptFCKActivate()
'Register _JavaScript block for Search Incident button (HTML Control)
Dim JavaScriptCode as String = "
&"function ActivateFCKEditor(objName)"& vbCRLF _
&"{"& vbCRLF _
&" var oFCKeditor = new FCKeditor( objName ) ;"& vbCRLF _
&" oFCKeditor.BasePath = './FCKeditor/' ;"& vbCRLF _
&" oFCKeditor.Height = 300 ;"& vbCRLF _
&" oFCKeditor.Width = 600 ;"& vbCRLF _
&" oFCKeditor.ReplaceTextarea() ;"& vbCRLF _
&"} //--> </SCRIPT>"& vbCRLF

If IsClientScriptBlockRegistered("FCKJSLib") Then
RegisterClientScriptBlock("FCKActivate", JavaScriptCode)
End If
End Sub

Private Sub StartupScriptFCKRun()
'Register _JavaScript block for Search Incident button (HTML Control)
Dim JavaScriptCode as String = "
&" ActivateFCKEditor('txtBox1');"& vbCRLF _
&"//--> </SCRIPT>"& vbCRLF

If (IsClientScriptBlockRegistered("FCKJSLib") AND
IsClientScriptBlockRegistered("FCKActivate")) Then
RegisterStartupScript("FCKRun", JavaScriptCode)
End If

End Sub

The first two functions are executed in the Page_Load function. The last
function is supposed to be associated with a command button to activate the
editor.

It's a round-about way but it works.

"Darren Kopp" <da********@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Quite a few people have. If you are looking for a Rich Text Box
editor, check out this blog post and associated comments for a list of
great RTB controls (some pay, some free).

http://scottonwriting.net/sowblog/posts/4252.aspx

HTH,
Darren Kopp
http://blog.secudocs.com/

Mar 8 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.