Cannot change content in CE?

Last post 06-30-2008, 7:04 PM by hatakelei. 5 replies.
Sort Posts: Previous Next
  •  05-26-2006, 5:09 AM 19544

    Cannot change content in CE?

    Hi,
     
    Only just started playing with this so it's probably something really basic but I load up an instance of CE, attempt to set the text and then add it to a placeholder for display in the browser. It's currently doing this on each page load - inefficient I know but I'll change that in future. However, if I set the text the first time it displays, if it's set to something else the next time it won't change but only show the original text? What am I doing wrong?
     
    Code snippet:

    CuteEditor.
    Editor ce = new CuteEditor.Editor();

    if (_contentID != "") //param passed in when link on client is clicked
    {
       ce.Text = LoadContent(); //returns string of content from DB
    }
    else //otherwise put in default text
    {
       ce.Text = "Please enter some content";
    }

    phEditArea.Controls.Add(ce);
     
    Any suggestions? Is it something to do with ViewState?
    Thanks!!
    Clare

     

  •  05-26-2006, 12:35 PM 19552 in reply to 19544

    Re: Cannot change content in CE?

    Clare,
     
    Try put your code into the following block:
     
    if (!IsPostBack)
    {
       if (_contentID != "") //param passed in when link on client is clicked
       {
          ce.Text = LoadContent(); //returns string of content from DB
       }    
       else //otherwise put in default text
       {
          ce.Text = "Please enter some content";
       }
    }
     
    If it doesn't help, please send an example (as simple as possible) to me.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  05-31-2006, 10:22 AM 19661 in reply to 19552

    Re: Cannot change content in CE?

    Hi,
     
    bit of an update. Got it to take content - by putting the Editor directly in the aspx page, not dynamically from the code behind.
     
    However it now gets more complex. We're trying to use Atlas in this site (Microsoft's take on Ajax - so basically it doesn't post the whole page back and refresh the page, but makes the call behind the scenes so to speak and repaints only the relevant controls)
     
    So the scenario is I have a Treeview on one side of the page - this automatically uses the callback functionality so it doesn't have to refresh the page, and dynamically loads a list of web pages and, under each of those, the content assigned to them. Clicking an item of content opens it for editing on the other side of the page. This side includes a text box for a name, summary, start and end dates etc and the CuteEditor (or it hopes to). Using Atlas the page doesn't need to do the whole postback and 'flicker' but the textboxes etc are redrawn with their new values.
     
    If I take the Editor out of the page, this works as it should - I can debug and see values being assigned into text boxes etc on the page and all appears correctly. If I put the CuteEditor in, I can still see the values being assigned (including into the Text property of the Editor) but now nothing changes on the client, not even the textboxes which previously did.
     
    Are there any known issues with Atlas/Ajax? It would take a lot of code to send the whole example, so are there any bits that might help?
     
    Thanks
    Clare
  •  06-30-2008, 1:00 AM 41797 in reply to 19661

    Re: Cannot change content in CE?

    Hi Adam,
     
    I'm afraid I have to raise this issue back from the dead. I have the same problem at the moment. I want to get the current content of the editor and I am using Ajax .net. It seems that you can't get the current content of CuteEditor when the page don't postback..
    Is there a way around this? Please give me an update. I am looking for a workaround myself and I will post my update if there is any.
     
    Thanks,
    Leah
  •  06-30-2008, 2:48 PM 41840 in reply to 41797

    Re: Cannot change content in CE?

  •  06-30-2008, 7:04 PM 41850 in reply to 41840

    Re: Cannot change content in CE?

    Adam,
     
    I have already run that sample, but I am not sure what it does. I entered some text on the textbox and somehow I expect that it will be shown on some other controls.
View as RSS news feed in XML