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

Issue in RadEditor when switching between Design and Html View

3 Answers 147 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 18 Jan 2012, 04:22 AM

  we have found a issue that adding duplicate attributes to a perticular tag if src attribute is there.
it is occured when When I added following Java script
“<script src="¬test-test.js"></src>”  to an existing HTML content “<STRONG><FONT size=6 face="Courier New">test jayani<BR>
    <BR>
    &nbsp;<IMG title=test alt=test src="/CurrentCourse/logo.jpg">&nbsp;</FONT></STRONG>”

after adding those scripts and switching between design and html views it comes like this

<strong><font size="6" face="Courier New">test jayani<br>
    <br> <script src="¬test-test.js"></src>
    &nbsp;<IMG title=test alt=test src="/CurrentCourse/logo.jpg" originalAttribute="src" originalPath="/CurrentCourse/logo.jpg" originalAttribute="src" originalPath="/CurrentCourse/logo.jpg" originalAttribute="src" originalPath="/CurrentCourse/logo.jpg">&nbsp;</FONT></STRONG>
</body></script></font></strong>

here originalAttribute and originalPath attributes keep on adding to the IMG tag. This is happens when "MakeUrlsAbsolute" filter is on.  This will work as same for the java scripts as well.
Please take a look on this and do needful.

Thanks

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Jan 2012, 01:15 PM
Hello,

The content that you load is invalid and this misleads the regular expressions of the MakeUrlsAbsolute filter of RadEditor. It is not allowed to close a script tag with </src> tag and you cannot produce such content with RadEditor tools. If you think that your users could go to HTML mode and write such content, it is better to disable HTML mode setting EditModes="Design,Preview".

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Manoj
Top achievements
Rank 1
answered on 14 Feb 2012, 08:06 PM
Rumen,

I'm able to save the content with <script> tags (to the database) by disabling the RemoveScripts filter. However, after loading the content and I switch to the HTML view, the script block, for example, <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5906605.js"></script> disappears!

I believe we're using the version "RadControls for ASP.NET AJAX Q3 2010"

Appreciate your help.

Thanks

Manoj
0
Rumen
Telerik team
answered on 16 Feb 2012, 04:58 PM
Hi,

Could you please disable the RemoveScripts filter by setting and enabling the desired filters inline through the ContentFilters property of RadEditor, e.g.

<telerik:RadEditor ID="RadEditor1" runat="server" ContentFilters="ConvertToXhtml,ConvertFontToSpan,OptimizeSpans,MozEmStrong">
    <Content>aaa<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/5906605.js"></script></Content>
</telerik:RadEditor>

This works for me.

Kind regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Editor
Asked by
Tom
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or