ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - HTML Editor - Surround selected content with HTML text

This example demonstrates how to use moveToWord() method of the Obout.Ajax.UI.HTMLEditor.DesignPanel component.

Here you can set cursor to the specified word in the content or select(highlight) the specified word.


Plain text word number (start from 0):


Font Size Header 
Aa
ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.HTMLEditor" TagPrefix="obout" %>
Plain text word number (start from 0):
<asp:TextBox runat="server" ID="numberOfWord" Text="0" style="width:30px" /><br />
<asp:Button runat="server" OnClientClick="return doit(2);" Text="Select the whole word" />
<asp:Button runat="server" OnClientClick="return doit(0);" Text="Set cursor to the start of the word" />
<asp:Button runat="server" OnClientClick="return doit(1);" Text="Set cursor to the end of the word" />
<obout:Editor runat="server" Id="editor" Height="400px" Width="100%" />
...
<script type="text/javascript">
  function doit(mode) {
     var designMode = Obout.Ajax.UI.HTMLEditor.ActiveModeType.Design;
     var editPanel = $find("<%= editor.ClientID %>").get_editPanel();
     // current mode
     var activeMode = editPanel.get_activeMode();
     // for 'Design' mode only
     if (activeMode == designMode) {
        var designPanel = editPanel.get_activePanel();
        var inputElement = $get("<%= numberOfWord.ClientID %>");
        var n = parseInt(inputElement.value);
        n = isNaN(n) ? 0 : n;
        inputElement.value = n;
        designPanel.moveToWord(n, mode);
     }
     return false;
  }
</script>

"One more thing I would like to share with you guys is, what a great outstanding solutions and very quick response with efficient support. I'm really so inspired with these components and it’s like very superior while working with these components. I'm so impressed and great work. I hope you are shaking presentation in this world :) Thank you once again ALL THE BEST!"

R.B.

Random testimonial   All testimonials