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

Embed JavaScript code in RadEditor

Environment

ProductRadEditor for ASP.NET AJAX

Description

What is the best way to insert (embed) JavaScript code in HTML mode of the Telerik Editor control? Learn the answer in the Solution section below.

Solution

By default, RadEditor strips the script tags to prevent script code execution and XSS.

There are two content filters responsible for the script encoding and removal:

You can disable one or both of them with the following C# code:

C#
RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.EncodeScripts));
RadEditor1.DisableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts));
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support