New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnImportContent
The OnImportConent event fires just before the content is imported in the Telerik Editor control. It provides access to the content that is going to be imported so you can modify it (Example 2).
The event handler receives two arguments:
-
Sender–the RadEditor instance that raised the event.
-
Event arguments–an object of type Telerik.Web.UI.EditorImportingArgs that exposes the HtmlFormatProvider and the RadFlowDocument instances with which you can programmatically control the settings or the content imported.
Example 1: Using the event to modify the ExportSettings of the HtmlFormatProvider instance.
ASP.NET
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnImportContent="RadEditor1_ImportContent">
</telerik:RadEditor>
<asp:Button runat="server" ID="Button1" Text="Import DOCX Content" OnClick="Button1_Click" />
Example 2: Adding an additional paragraph to the RadFlowDocument through the OnImportContent event.
ASP.NET
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnImportContent="RadEditor1_ImportContent">
</telerik:RadEditor>
<asp:Button runat="server" ID="Button1" Text="Import DOCX" OnClick="Button1_Click" />