Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Handling key events for WebTextEditor
posted

I have two WebTextEditor controls on a page. As a user types into the first WebTextEditor control, I would like to process the text on the server (via AJAX) and display the translated text in the second WebTextEditor control. The translation requires a database lookup which is why it needs to happen on the server. I would like to do this on each key-up in the first control. Jamie

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi Chuck,

    Similar is beyond features of WebTextEditor, however that is quite easy to implement by application. You may process ClientEvents.KeyUp (or similar) of source editor, trigger a postback of UpdatePanel where target editor is located and on server you may set text to target editor from value of source. Below is example for you:

    <script type="text/javascript">
    function editor1KeyUp(editor, args)
    {
     __doPostBack('UpdatePanel1TriggerID', '');
    }
    </script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
      <ContentTemplate>
        <span id="UpdatePanel1TriggerID" style="display:none;visibility:hidden;"></span>
        <ig:WebTextEditor ID="WebTextEditor2" runat="server"></ig:WebTextEditor>
      </ContentTemplate>
    </asp:UpdatePanel>
    <ig:WebTextEditor ID="WebTextEditor1" runat="server">
      <ClientEvents KeyUp="editor1KeyUp" />
    </ig:WebTextEditor>

    protected void Page_Load(object sender, EventArgs e)
    {
      this.WebTextEditor2.Text = this.WebTextEditor1.Text;
    }

Children
No Data