Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Editor / Using ToolProviderID

There are 5 RadEditor objects. Maximum optimization is achieved when both properties are used together

   
  
 
 
   

   
  
 
 
   

   
  
 
 
   

   
  
 
 
   

   
  
 
 
   

  • In this example you can review how to use the editor's ToolProviderID property. The ToolProviderID property helps to significantly reduce the HTML markup and JSON(Javascript Object Notation) sent from server to the client when multiple RadEditor objects with the same tools are used on the same page. The ToolProviderID should be set to the ID of another RadEditor e.g.

    ASPX:

    <telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
    <telerik:radeditor runat="server" ID="RadEditor2" ToolProviderID="RadEditor1"></telerik:radeditor>
    <telerik:radeditor runat="server" ID="RadEditor3" ToolProviderID="RadEditor1"></telerik:radeditor>
    ............

    Code-Behind:
    RadEditor2.ToolProviderID = "RadEditor1";
    RadEditor3.ToolProviderID = "RadEditor1";
    ............

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Theme="Default" Language="C#" AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs"
        Inherits="Telerik.Web.Examples.Editor.ToolProvider.DefaultCS" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag ID="Headtag1" runat="server" />
    </head>
    <body class="BODY">
            <script type="text/javascript">
            //<![CDATA[
            //Get server time, UTC
            var serverTime = new Date(<%= this.ServerTime %>);
                        
            //Get current time and change it to UTC
            var utc = new Date();
            utc.setHours(utc.getHours() + utc.getTimezoneOffset()/60);
            
            //Calculate time it took for the page to come from server
            var travelTime = utc - serverTime;
            var size = null;
            window.onload = function()
            {
             //Get the editor's HTML
             size = Math.floor($get("editorArea").innerHTML.length);
             //Get the initialization script
             var scripts = document.getElementsByTagName("script");
             var lastScript = scripts[scripts.length - 1];
             size +=lastScript.innerHTML.length;
             size = Math.floor(size / 1028);
            }
            
            var date = new Date();
            
            function pageLoad()
            {
                if (!size) size = "N/A";
                var div = document.getElementById("MessageDiv");
                var message = "Travel time from server is " + travelTime
                             + " msec. Editor HTML Size is " + size
                             + " KB. <br/><br/>Client page HTML parsing took the browser "
                             + (new Date() - date)+ " miliseconds";
                div.innerHTML = message;
            }
            //]]>
            </script>
        <form id="form1" runat="server">
            <qsf:Header ID="Header1" runat="server" NavigationLanguage="c#" />
            <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
            <qsf:InformationBox ID="InformationBox1" runat="server">
                <h3 id="MessageDiv"><!-- / --></h3>
               </qsf:InformationBox>
            <div id="editorArea">
                <p>There are 5 RadEditor objects. Maximum optimization is achieved when both properties are used together</p>
                <ul style="padding: 0; margin: 0; list-style: none;">
                    <li><asp:CheckBox ID="UseToolProvider" runat="server" Checked="false" Text="Use Tool Provider" title="Use Tool Provider" /></li>
                    <li><asp:CheckBox ID="UseShowOnFocusToolbarMode" Checked="false" Text="Use ShowOnFocus Toolbar Mode" runat="server" title="Use ShowOnFocus Toolbar Mode" /></li>
                </ul>
                <p>
                    <asp:Button ID="SubmitButton" runat="server" Text="Apply Settings" title="Apply Settings" CssClass="button" />
                </p>
                <telerik:RadEditor ID="RadEditor1" runat="server" Height="300px">
                    <Modules>
                        <telerik:EditorModule Name="RadEditorStatistics" DockingZone="Bottom" Enabled="True" Visible="True" />
                    </Modules>
                </telerik:RadEditor>
                <br />
                <telerik:RadEditor ID="RadEditor2" runat="server" Height="300px"></telerik:RadEditor>
                <br />
                <telerik:RadEditor ID="RadEditor3" runat="server" Height="300px"></telerik:RadEditor>
                <br />
                <telerik:RadEditor ID="RadEditor4" runat="server" Height="300px"></telerik:RadEditor>
                <br />
                <telerik:RadEditor ID="RadEditor5" runat="server" Height="300px"></telerik:RadEditor>
            </div>
            <qsf:Footer runat="server" ID="Footer1" />
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerikโ€™s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451