Problem with .text property

Last post 01-14-2007, 6:27 PM by ysw. 2 replies.
Sort Posts: Previous Next
  •  01-13-2007, 5:01 PM 25771

    Problem with .text property

    I'm using Cute Editor to let people edit posts in their blogs. When they want to edit a post, I load the Edit page and put their post into CuteEditor like this:
     
    Editor1.Text = strMessage
     
    After they have typed their changes, I then want to save the new text, which I do with a call to a stored proc in my SQL db. The proc needs receive the new text. So I then say
     
    strMessage = Editor1.Text
    and send strMessage to the proc.
     
    Since this was not working, I stepped through the code and found that when referring to Editor1.Text in the second part, the .Text property only contains the text that was originally loaded in Part 1 (!!).
     
    Any idea why this is happening and what I could do to get around it?
     
    Thanks.
     

     

  •  01-14-2007, 4:22 PM 25777 in reply to 25771

    Re: Problem with .text property

    ysw,
     
    Can you post your code? If you put the code of saving into Page_Load event, you must make sure IsPostBack is true.
     
    For example:
     
    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
      {
         if (IsPostBack)
      { 
          strMessage = Editor1.Text
       }
      else
      { 
          Editor1.Text = "Type Here";
      }
     
     }
    </script>

    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

  •  01-14-2007, 6:27 PM 25785 in reply to 25777

    Re: Problem with .text property

    I was the postback messing me up. Thanks.
View as RSS news feed in XML