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
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;}