All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
New to Telerik UI for ASP.NET AJAX? Download free 30-day trial
Note: At least one EditMode should be checked
This demo demonstrates how to render the RadEditor's content area as an editable DIV element, rather than the default IFRAME content area mode.
ContentAreaMode - This property specifies if the content area element of RadEditor is editable IFRAME or DIV. There are two values available for the property: "Iframe" and "Div". The default value is "Iframe". These are the main differences between Div and Iframe content area modes:
<%@ Page Theme="Default" Language="vb" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb"Inherits="Telerik.Web.Examples.Editor.ContentAreaModeDiv.DefaultVB" %> <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %> <!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head runat="server"> <title>Telerik ASP.NET Example</title> <link href="../Common/styles.css" rel="stylesheet" type="text/css" /> <link href="styles.css" rel="stylesheet" /> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" /> <div class="demo-containers"> <div class="demo-container"> <telerik:RadEditor RenderMode="Lightweight" ContentAreaMode="Div" runat="server" ID="RadEditor1" SkinID="DefaultSetOfTools" Height="515px" CssClass="centered-editor"> <ImageManager ViewPaths="~/Editor/images/UserDir/Marketing,~/Editor/images/UserDir/PublicRelations" UploadPaths="~/Editor/images/UserDir/Marketing,~/Editor/images/UserDir/PublicRelations" DeletePaths="~/Editor/images/UserDir/Marketing,~/Editor/images/UserDir/PublicRelations" /> </telerik:RadEditor> </div> </div> <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="CheckBoxListEditMode"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="CheckBoxListEditMode" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadioButtonToolsFile"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadioButtonToolsFile" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadioButtonListAutoResizeHeight"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadioButtonListAutoResizeHeight" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="RadioButtonListEnabled"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="RadioButtonListEnabled" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="NewLineModeButtonList"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadEditor1" LoadingPanelID="RadAjaxLoadingPanel1" /> <telerik:AjaxUpdatedControl ControlID="NewLineModeButtonList" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"> </telerik:RadAjaxLoadingPanel> <qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1"> <Views> <qsf:View runat="server"> <qsf:ConfiguratorColumn runat="server" Size="Medium"> <ul class="fb-group"> <li> <qsf:CheckBoxList runat="server" ID="CheckBoxListEditMode" Label="Change Edit Mode" OnSelectedIndexChanged="CheckBoxListEditMode_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Value="Design" Selected="True">Design Mode</asp:ListItem> <asp:ListItem Value="Html" Selected="True">Html Mode</asp:ListItem> <asp:ListItem Value="Preview" Selected="True">Preview Mode</asp:ListItem> </qsf:CheckBoxList> <p> <em><strong>Note</strong>: At least one EditMode should be checked</em> </p> </li> <li> <qsf:RadioButtonList runat="server" ID="RadioButtonToolsFile" Label="Choose tools file" OnSelectedIndexChanged="RadioButtonToolsFile_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Value="FullSet">Full set of tools</asp:ListItem> <asp:ListItem Value="Default" Selected="True">Default</asp:ListItem> <asp:ListItem Value="BasicTools">Basic toolset</asp:ListItem> </qsf:RadioButtonList> </li> <li> <qsf:RadioButtonList runat="server" ID="RadioButtonListEnabled" Label="Enable/Disable RadEditor" OnSelectedIndexChanged="RadioButtonListEnabled_SelectedIndexChanged" AutoPostBack="true" Orientation="Horizontal"> <asp:ListItem Value="Enable" Selected="true">Enable</asp:ListItem> <asp:ListItem Value="Disable">Disable</asp:ListItem> </qsf:RadioButtonList> </li> </ul> </qsf:ConfiguratorColumn> <qsf:ConfiguratorColumn runat="server" Size="Medium"> <ul class="fb-group"> <li> <h4>Toolbar Mode</h4> <qsf:ComboBox runat="server" ID="ChooseToolbarMode" OnTextChanged="ChooseToolbarMode_TextChanged" AutoPostBack="true"> <Items> <telerik:RadComboBoxItem runat="server" Selected="True" Text="Default" Value="Default"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="PageTop" Value="PageTop"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="ShowOnFocus" Value="ShowOnFocus"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="Floating" Value="Floating"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="RibbonBar" Value="RibbonBar"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="RibbonBarFloating" Value="RibbonBarFloating"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="RibbonBarPageTop" Value="RibbonBarPageTop"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem runat="server" Text="RibbonBarShowOnFocus" Value="RibbonBarShowOnFocus"></telerik:RadComboBoxItem> </Items> <CollapseAnimation Duration="200" Type="OutQuint"></CollapseAnimation> </qsf:ComboBox> </li> <li> <qsf:RadioButtonList Orientation="vertical" OnSelectedIndexChanged="RadioButtonListAutoResizeHeight_SelectedIndexChanged" ID="RadioButtonListAutoResizeHeight" runat="server" AutoPostBack="True" Label="Enable / Disable AutoResizeHeight"> <asp:ListItem Value="True">Auto Resize to Fit Content Height (no scrollers)</asp:ListItem> <asp:ListItem Selected="True" Value="False">Fixed-height content Area (with scrollers)</asp:ListItem> </qsf:RadioButtonList> </li> <li> <qsf:RadioButtonList runat="server" ID="NewLineModeButtonList" Label="New Lines as" OnSelectedIndexChanged="NewLineModeList_SelectedIndexChanged" AutoPostBack="true"> <asp:ListItem Value="Br">Breaks</asp:ListItem> <asp:ListItem Value="P" Selected="true">Paragraphs</asp:ListItem> <asp:ListItem Value="Div">Divs</asp:ListItem> </qsf:RadioButtonList> </li> </ul> </qsf:ConfiguratorColumn> </qsf:View> </Views> </qsf:ConfiguratorPanel> </form> </body> </html>