This is a migrated thread and some comments may be shown as answers.

[Solved] javascript in Editor Body

3 Answers 108 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Karl Wilkens
Top achievements
Rank 1
Karl Wilkens asked on 08 Dec 2009, 03:33 PM
Hi, we have AllowScripts set to true in our radEditor, but no matter what we do, any attempts to insert a simple javascript function get stripped out. Is there a hidden trick to allowing this to happen? Thanks.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Dec 2009, 03:58 PM
Hi Karl,

You should disable the RemoveScripts filter of RadEditor, which strips the <script> tags to reduce the possibility of cross-site scripting and other script-related problems:

RadEditor1.DisableFilter(EditorFilters.RemoveScripts)


Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Karl Wilkens
Top achievements
Rank 1
answered on 08 Dec 2009, 04:25 PM
That had no effect. We are creating the editor in code behind like this

       Dim EditorObj As New Telerik.Web.UI.RadEditor
....


      EditorObj.AllowScripts = True
        EditorObj.DisableFilter(EditorFilters.RemoveScripts)

any ideas?
 

0
Rumen
Telerik team
answered on 10 Dec 2009, 12:51 PM
Hi Karl,

I am not sure what is causing the problem on your side and for that reason I prepared for your and attached a sample fully working project and video demonstrating how to disable the RemoveScript filter and allow the execution of script in RadEditor.


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Karl Wilkens
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Karl Wilkens
Top achievements
Rank 1
Share this question
or