New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

OnExportContent

The OnExportContent event fires just before the content from the Telerik Editor is exported. It provides access to the generated output, so that it could be used or modified upon further application requirements.

The event handler receives two arguments:

  1. Sender–the RadEditor instance that raised the event.

  2. Event arguments–an object of type Telerik.Web.UI.EditorExportingArgs exposes the string ExportOutput property, the Telerik.Web.UI.ExportType property and a Boolean Cancel property with which you can cancel the sending of the file to the client (by default is set to false).

Example 1: How to save the ExportOutput to a file on the server and prevent it from being sent to the client.

ASP.NET
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnExportContent="RadEditor1_ExportContent" ContentFilters="DefaultFilters, PdfExportFilter">
</telerik:RadEditor>
<asp:Button runat="server" ID="Button1" Text="Export to PDF" OnClick="Button1_Click" />

Example 2: Dynamically adding header and footer elements to the exported document in the OnExportContent event.

ASP.NET
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnExportContent="RadEditor1_ExportContent" ContentFilters="DefaultFilters, PdfExportFilter"></telerik:RadEditor>
<asp:Button runat="server" ID="Button1" Text="Export to DOCX" OnClick="Button1_Click" />

See Also

In this article
See Also
Not finding the help you need?
Contact Support