New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Custom Modules

  • Show/Hide Border
  • Table Properties
  • Delete Table
  • Row
    • Insert Row Above
    • Insert Row Below
    • Delete Row
  • Column
    • Insert Column to the Left
    • Insert Column to the Right
    • Delete Column
  • Cell
    • Merge Cells Horizontally
    • Merge Cells Vertically
    • Split Cell Horizontally
    • Split Cell Vertically
    • Delete Cell
  • Cell Properties
  • Table Properties
  • Properties...
  • Image Map Editor
  • Properties...
  • OpenLink
  • Remove Link
  • Insert Select
  • Cut
  • Copy
  • Paste
  • Paste from Word
  • Paste Plain Text
  • Paste As Html
  • Paste Html

The example shows how to create a simple module that displays the count of tables and images in the content area.

To create a custom module register its tag in the Modules inner-tag of RadEditor. Please, note that at least one of the built-in modules should be registered when creating a custom module, because due to optimization purposes the editor will not register its modules javascript code if some of the built-in modules is not declared:

<telerik:radeditor runat="server" ID="RadEditor1" Height="700px">
      <telerik:EditorModule Name="MyModule" Enabled="true" Visible="true"/>
      <telerik:EditorModule Name="RadEditorStatistics" Enabled="true" Visible="true"/>
Modules >
</ telerik:radeditor >

and after that implement the initializeBase function, e.g.

<script type = "text/javascript" >
= function (element)
this , [element]) ;

    initialize :
function ()
this , 'initialize' ) ;
selfPointer = this;
.get_editor().add_selectionChange( function (){ selfPointer.doSomething() ; }) ;
.doSomething() ;

    //A method that does the actual work - it is usually attached to the "selection changed" editor event
    doSomething : function ()
        var span = document .createElement ( "SPAN" ) ;
        span.innerHTML = this .get_editor().get_html() ;

imageCount = span.getElementsByTagName( "IMG" ).length ;
tableCount = span.getElementsByTagName( "TABLE" ).length ;

element = this .get_element() ;
        element.innerHTML = "<b>CUSTOM MODULE: Images: " + imageCount + " Tables: " + tableCount + "</b>" ; = "1px solid red" ; = "yellow" ; = "red" ;

MyModule.registerClass( 'MyModule' , Telerik.Web.UI.Editor.Modules.ModuleBase) ;
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • scripts.js
<%@ Page Language="vb" Theme="Default" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb"Inherits="Telerik.Web.Examples.Editor.BuiltinCustomModules.DefaultVB"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
<link href="../Common/styles.css" rel="stylesheet" type="text/css" />
    <script src="scripts.js" type="text/javascript"></script>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-wide">
        <telerik:RadEditor RenderMode="Lightweight" SkinID="DefaultSetOfTools" runat="server" ID="RadEditor1" Width="800px" OnClientInit="telerikDemo.editor_onClientLoad">
                <telerik:EditorModule Name="telerikDemo.MyModule" Enabled="true" Visible="true"></telerik:EditorModule>
                <telerik:EditorModule Name="RadEditorStatistics" dockingzone="bottom" Visible="true"
            <table style="WIDTH: 650px; HEIGHT: 305px" cellspacing="2" border="1">
                        <td> <img alt="product logo" src="../../images/productLogoLight.gif" /></td>
                        <p align="justify"><span style="COLOR: 111111;FONT-SIZE: 11px; FONT-FAMILY: MS Sans Serif">is the successor of the well known industry standard Editor for ASP.NET. The tight integration with ASP.NET AJAX and the powerful new capabilities make Telerik's WYSIWYG Editor a flexible and lightweight component, turning it into the fastest loading Web Editor. Among the hottest features are: </span></p>
                            <li><em>Single-file, drag-and-drop deployment</em> </li>
                            <li><em>Built on top of ASP.NET AJAX</em> </li>
                            <li><em>Unmatched loading speed with new semantic rendering </em></li>
                            <li><em>Full keyboard accessibility</em> </li>
                        <li><em>Flexible Skinning mechanism</em> </li>
                        <li><em>Simplified and intuitive toolbar configuration</em> </li>
                        <li><em>Out-of-the-box XHTML-enabled output</em></li>
                        <li><em>Full keyboard accessibility</em> </li>

Support & Learning Resources

Find Assistance