Click here to Skip to main content
13,505,987 members
Rate this:
Please Sign up or sign in to vote.
Hi All,

I am using vs2008, web application.

I have one textbox, button and ajax editor control. when i click on button then textbox data should be inserted in ajax editor content with selected cursor position.

how can do this using java script or code.
plz help

Posted 14-Dec-12 21:29pm
Updated 16-Dec-12 19:38pm
Krunal Rohit 15-Dec-12 3:31am
Elaborate your question...
-Krunal R.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can do this using Javascript
function InsertAtCaret() {
            try {
                var editor = $find("<%= EdPatconsuForm.ClientID %>");//HtmlEditor Id
                editPanel = editor.get_editPanel();
                if (editPanel.get_activeMode() == 0) {
                    var designPanel = editPanel.get_activePanel();
                    designPanel.insertHTML('your text');///pass your text here
                    setTimeout(function () { designPanel.onContentChanged(); editPanel.updateToolbar(); }, 0);
            } catch (e) { alert(e); }

Hope your Problem Will Solve :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180417.1 | Last Updated 29 Jun 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100