Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to use FCKeditorV2 instead of FreeTextBox ?

How to use FCKeditorV2 instead of FreeTextBox ?

Scheduled Pinned Locked Moved ASP.NET
csharpcomdesignhelptutorial
10 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2456424
    wrote on last edited by
    #1

    I want to use FCKeditorV2 (Figure 2) http://www.mediafire.com/view/pdmvi0aezyqpil5/website2010\_10b.jpg/file instead of FreeTextBox (Figure 1) http://www.mediafire.com/view/oahtm7k3883elow/website2010\_10a.jpg/file The code I have edited

    In file ArticleAddEdit.aspx
    line 5:
    original
    <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

    edit
    <%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>

    line 79:
    original:

    edit:

    But when I change the code the following error message: http://www.mediafire.com/view/zpze8g7k7o3wm4a/website2010\_10c.jpg/file Line 40: txtTitle.Text = obj.Title; Line 41: txtExcerpt.Text = obj.Excerpt; Line 42: txtBody.Text = obj.Body; Line 43: if (obj.Priority == 1) Line 44: chkPriority.Checked = true; For the original code

    In file In file ArticleAddEdit.aspx
    <%@ Page ValidateRequest="false" Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master" AutoEventWireup="true" CodeFile="ArticleAddEdit.aspx.cs" Inherits="webapp4U.UI.ArticleAddEdit" %>
    <%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
    <%@ Import Namespace="webapp4U" %>
    <%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>
    <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

    Richard DeemingR 1 Reply Last reply
    0
    • U User 2456424

      I want to use FCKeditorV2 (Figure 2) http://www.mediafire.com/view/pdmvi0aezyqpil5/website2010\_10b.jpg/file instead of FreeTextBox (Figure 1) http://www.mediafire.com/view/oahtm7k3883elow/website2010\_10a.jpg/file The code I have edited

      In file ArticleAddEdit.aspx
      line 5:
      original
      <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

      edit
      <%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>

      line 79:
      original:

      edit:

      But when I change the code the following error message: http://www.mediafire.com/view/zpze8g7k7o3wm4a/website2010\_10c.jpg/file Line 40: txtTitle.Text = obj.Title; Line 41: txtExcerpt.Text = obj.Excerpt; Line 42: txtBody.Text = obj.Body; Line 43: if (obj.Priority == 1) Line 44: chkPriority.Checked = true; For the original code

      In file In file ArticleAddEdit.aspx
      <%@ Page ValidateRequest="false" Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master" AutoEventWireup="true" CodeFile="ArticleAddEdit.aspx.cs" Inherits="webapp4U.UI.ArticleAddEdit" %>
      <%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
      <%@ Import Namespace="webapp4U" %>
      <%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>
      <%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      FCKeditor hasn't been updated since 2007. Whilst it might work, there's a good chance there will be problems using it in newer browsers. And if you do encounter any problems, you won't get any support or bug fixes. You'll probably have better luck using the replacement, CKeditor. You'll just need to be aware of the licensing restrictions for the free version.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      J 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        FCKeditor hasn't been updated since 2007. Whilst it might work, there's a good chance there will be problems using it in newer browsers. And if you do encounter any problems, you won't get any support or bug fixes. You'll probably have better luck using the replacement, CKeditor. You'll just need to be aware of the licensing restrictions for the free version.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        J Offline
        J Offline
        jkirkerx
        wrote on last edited by
        #3

        That was a common error with FCKeditor, getting the text from the JavaScript object. You will have the same issue with CKeditor as well, because it uses the same code to place and grab text from the ckeditor object. I remember having to link some Javascript to transfer the text, and check for ckinstance and ckdirty before accessing the ckobject. From your post, I can tell your pretty new to CKeditor and haven't gotten to using js files to program the environment yet, or didn't run the sample project provided for you to learn from that is fully functional. I suggest you run the tutorial project in ckeditor.

        If it ain't broke don't fix it Discover my world at jkirkerx.com

        U Richard DeemingR 2 Replies Last reply
        0
        • J jkirkerx

          That was a common error with FCKeditor, getting the text from the JavaScript object. You will have the same issue with CKeditor as well, because it uses the same code to place and grab text from the ckeditor object. I remember having to link some Javascript to transfer the text, and check for ckinstance and ckdirty before accessing the ckobject. From your post, I can tell your pretty new to CKeditor and haven't gotten to using js files to program the environment yet, or didn't run the sample project provided for you to learn from that is fully functional. I suggest you run the tutorial project in ckeditor.

          If it ain't broke don't fix it Discover my world at jkirkerx.com

          U Offline
          U Offline
          User 2456424
          wrote on last edited by
          #4

          I did my own research, tinkering and programming, according to you in addition to FCKeditor and CKeditor, currently the programming tool supports better than CKeditor what tool do you use ?

          J 1 Reply Last reply
          0
          • J jkirkerx

            That was a common error with FCKeditor, getting the text from the JavaScript object. You will have the same issue with CKeditor as well, because it uses the same code to place and grab text from the ckeditor object. I remember having to link some Javascript to transfer the text, and check for ckinstance and ckdirty before accessing the ckobject. From your post, I can tell your pretty new to CKeditor and haven't gotten to using js files to program the environment yet, or didn't run the sample project provided for you to learn from that is fully functional. I suggest you run the tutorial project in ckeditor.

            If it ain't broke don't fix it Discover my world at jkirkerx.com

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            Why have you replied to me instead of the OP? :laugh:


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            Z J 2 Replies Last reply
            0
            • Richard DeemingR Richard Deeming

              Why have you replied to me instead of the OP? :laugh:


              "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

              Z Offline
              Z Offline
              ZurdoDev
              wrote on last edited by
              #6

              Richard Deeming wrote:

              instead of the OP?

              Maybe he's not down with OPP? :laugh:

              Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

              1 Reply Last reply
              0
              • U User 2456424

                I did my own research, tinkering and programming, according to you in addition to FCKeditor and CKeditor, currently the programming tool supports better than CKeditor what tool do you use ?

                J Offline
                J Offline
                jkirkerx
                wrote on last edited by
                #7

                I'm not sure what you mean by tool. I used both, starting with FCKEditor and then CKEditor in a Asp.Net Webform app. I got as far as writing JS files to program the editor, JS scripts to load the HTML, get the HTML back, and wrote Custom tools or controls to ... Upload new images, Set images from the Product database Place images and text, Load custom HtmlTemplates to showcase products Load custom HTML sections I got pretty good with CKEditor and customers liked it. But I haven't touched it in 3 years, I dropped Webforms and went Angular now. I think this is what your looking for. It took me a long time to understand how to save the HTML in the editor without reloading the form, and saving when posting the entire form back to the server. It's JQuery, that can write to input elements on the webform. This file calls functions in the main ckEditor JS file. I don't remember all the details to CKEditor, but I needed a JavaScript interface to write the HTML in the content container to a textbox or input form element, since the ckEditor container is not a form element. So you create a form element that represents the CKEditor HTML content data, and create sort of a hook to go back and forth to ckEditor object, and a panel/container to hold the CKEditor JavaScript object inside. The function is tied to a webform button OnClientClick(update_ckEditor_Preview())

                function update_ckEditor_Preview() {

                var ckEditor\_XHTML, ckEditor\_Instance, ckEditor\_Update, classic\_template;
                classic\_template = $('\[id\*="\_txt\_ProductEditor\_Template"\]').val();
                
                try {
                    var ckInstance = ckEditor\_GetInstance();
                    if (ckInstance !== null) {
                        var ckDirty = ckInstance.checkDirty;
                        ckEditor\_XHTML = ckInstance.getData();
                        ckEditor\_Instance = ckInstance.getData();            
                
                        if (ckDirty) {
                            ckInstance.resetDirty();
                        }
                                    
                        $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').empty();
                        $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').append(ckEditor\_XHTML);
                        $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').css('display', 'inline-block');
                        ckEditor\_Update = true;                        
                    }
                    else {
                        ckEditor\_XHTML = $('\[id\*="\_ck\_Editor\_ProductXHTML"\]').val();
                        $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').empty();
                        $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').append(ckEditor\_XHTML);
                        $('\[id\*="\_panel\_Display\_Classic\_X
                
                U 1 Reply Last reply
                0
                • Richard DeemingR Richard Deeming

                  Why have you replied to me instead of the OP? :laugh:


                  "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                  J Offline
                  J Offline
                  jkirkerx
                  wrote on last edited by
                  #8

                  Good question. It wasn't intentional. Perhaps lack of sleep, woke up at 4:30 and could not go back to sleep, so I went to work.

                  If it ain't broke don't fix it Discover my world at jkirkerx.com

                  1 Reply Last reply
                  0
                  • J jkirkerx

                    I'm not sure what you mean by tool. I used both, starting with FCKEditor and then CKEditor in a Asp.Net Webform app. I got as far as writing JS files to program the editor, JS scripts to load the HTML, get the HTML back, and wrote Custom tools or controls to ... Upload new images, Set images from the Product database Place images and text, Load custom HtmlTemplates to showcase products Load custom HTML sections I got pretty good with CKEditor and customers liked it. But I haven't touched it in 3 years, I dropped Webforms and went Angular now. I think this is what your looking for. It took me a long time to understand how to save the HTML in the editor without reloading the form, and saving when posting the entire form back to the server. It's JQuery, that can write to input elements on the webform. This file calls functions in the main ckEditor JS file. I don't remember all the details to CKEditor, but I needed a JavaScript interface to write the HTML in the content container to a textbox or input form element, since the ckEditor container is not a form element. So you create a form element that represents the CKEditor HTML content data, and create sort of a hook to go back and forth to ckEditor object, and a panel/container to hold the CKEditor JavaScript object inside. The function is tied to a webform button OnClientClick(update_ckEditor_Preview())

                    function update_ckEditor_Preview() {

                    var ckEditor\_XHTML, ckEditor\_Instance, ckEditor\_Update, classic\_template;
                    classic\_template = $('\[id\*="\_txt\_ProductEditor\_Template"\]').val();
                    
                    try {
                        var ckInstance = ckEditor\_GetInstance();
                        if (ckInstance !== null) {
                            var ckDirty = ckInstance.checkDirty;
                            ckEditor\_XHTML = ckInstance.getData();
                            ckEditor\_Instance = ckInstance.getData();            
                    
                            if (ckDirty) {
                                ckInstance.resetDirty();
                            }
                                        
                            $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').empty();
                            $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').append(ckEditor\_XHTML);
                            $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').css('display', 'inline-block');
                            ckEditor\_Update = true;                        
                        }
                        else {
                            ckEditor\_XHTML = $('\[id\*="\_ck\_Editor\_ProductXHTML"\]').val();
                            $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').empty();
                            $('\[id\*="\_panel\_Display\_Classic\_XHTML"\]').append(ckEditor\_XHTML);
                            $('\[id\*="\_panel\_Display\_Classic\_X
                    
                    U Offline
                    U Offline
                    User 2456424
                    wrote on last edited by
                    #9

                    123/5000 In this place I have replaced FCKeditorV2 for FreeTextBox but when running it does not appear the editor, do you know why ? you see attach file [http://www.mediafire.com/file/lvc6m3pupnd4430/website2010\_10d.jpg\](http://www.mediafire.com/file/lvc6m3pupnd4430/website2010\_10d.jpg)

                    J 1 Reply Last reply
                    0
                    • U User 2456424

                      123/5000 In this place I have replaced FCKeditorV2 for FreeTextBox but when running it does not appear the editor, do you know why ? you see attach file [http://www.mediafire.com/file/lvc6m3pupnd4430/website2010\_10d.jpg\](http://www.mediafire.com/file/lvc6m3pupnd4430/website2010\_10d.jpg)

                      J Offline
                      J Offline
                      jkirkerx
                      wrote on last edited by
                      #10

                      Well that solves linking a textbox to ckEditor and having to write JavaScript. I didn't want to download your image.

                      If it ain't broke don't fix it Discover my world at jkirkerx.com

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups