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

Editor generates target and re_target properties in links

16 Answers 144 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 07 Apr 2011, 07:57 PM
I'm working with the rad editor and have found that a link such as this:
<a href="#Download">Download Source</a>

will sometimes get changed to this:
<a target="_blank" re_target="null" href="#Download">Download Source</a>

I have no idea what is causing this to happen, but we work with the rad editor extensively and have found that about one out of every hundred documents containing links will randomly generate the above target and re_target properties. This causes all of the links to open in new windows.

I want to know if anyone has insight on this issue or even knows what causes it. This error is seemingly random and I have NOT been able to replicate it with hundreds of attempts. We create a large amount of different documents with the SAME links and some of them get these values generated for them.

One thing I did notice is that when switching from HTML view with the generated properties to PREVIEW and then back to HTML would most of the time clear the properties as if they were never there.

Any help is appreciated, thanks.

16 Answers, 1 is accepted

Sort by
0
Jamie
Top achievements
Rank 1
answered on 08 Apr 2011, 04:19 PM
Bump.
Anyone?
0
Dobromir
Telerik team
answered on 11 Apr 2011, 03:04 PM
Hi Jamie,

We are not aware of this problem and you are the first one to report it. I tried to reproduce it locally but to no avail. To able to provide assistance on this issue we will need to be able to observe and debug it locally. Could you please provide more detailed information on the specific scenario?
  • Which version of RadControls for ASP.NET AJAX and .NET Framework are used in the application?
  • Under which browser and its version the problem occurs?
  • Could you please provide the exact RadEditor's configuration with all the customizations applied to it so we can examine it further?

On a side note, re_target attribute is used to store the original target attribute's value when switching to preview mode.

All the best,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Jamie
Top achievements
Rank 1
answered on 11 Apr 2011, 04:35 PM
I am currently using version 2010.3.1317.0 of Telerik with .NET 4.0. The error seems to have occurred in the following browsers: Firefox 3.5, Google Chrome, IE 8 which leads me to believe that it is not browser specific.

Our rad editor looks like this:
<telerik:RadEditor ID="ContentEditor" runat="server" EnableResize="True" Height="500px"
    Width="100%" AllowScripts="False" ToolsFile="/_Config/ContentProductionEditorTools.xml"
    TemplateManager-ViewPaths="/Templates" TemplateManager-UploadPaths="/Templates">
    <CssFiles>
        <telerik:EditorCssFile Value="/_Styles/CodeBox.css" />
    </CssFiles>
 
    <Content>
    </Content>
    <ImageManager MaxUploadFileSize="20971520" />
    <DocumentManager MaxUploadFileSize="20971520" />
    <FlashManager MaxUploadFileSize="20971520" />
    <TemplateManager UploadPaths="/Templates" ViewPaths="/Templates" />
</telerik:RadEditor>

The tools file config looks like this:
<root>
 
 <tools name="MainToolbar" dockable="true" enabled="true" DockingZone="Left">
  <tool name="ImageManager" />
  <tool name="DocumentManager" />
  <tool name="TemplateManager" />
  <tool name="FormatCodeBlock" />
  
 </tools>
 
 <tools>
  <tool name="LinkManager" ShortCut="CTRL+K" />
  <tool name="Unlink" ShortCut="CTRL+SHIFT+K" />
  <tool separator="true"/>
  <tool name="AjaxSpellCheck" />
  <tool name="FormatStripper" />
  <tool name="XhtmlValidator" />
  <tool name="FindAndReplace" ShortCut="CTRL+F" />
  <tool name="SelectAll" ShortCut="CTRL+A" />
  <tool name="Cut" />
  <tool name="Copy" ShortCut="CTRL+C" />
  <tool name="Paste" ShortCut="CTRL+V" />
  <tool name="PasteStrip" />
  <tool separator="true"/>
  <tool name="Undo" ShortCut="CTRL+Z" />
  <tool name="Redo" ShortCut="CTRL+Y" />
 </tools>
 
 <tools>
  <tool name="InsertTableLight" ShortCut="CTRL+ALT+T" />
  <tool name="InsertFormElement" />
  <tool name="InsertSymbol" />
  <tool name="InsertSnippet" />
  
 </tools>
 
 <tools name="FormatToolbar" dockable="true" enabled="true">
  <tool name="ApplyClass" />
  <tool name="Bold" ShortCut="CTRL+B" />
  <tool name="Italic" ShortCut="CTRL+I" />
  <tool name="Underline" ShortCut="CTRL+U" />
  <tool name="StrikeThrough" />
  <tool separator="true"/>
  <tool name="FormatBlock" />
  <tool separator="true"/>
  <tool name="JustifyLeft" />
  <tool name="JustifyCenter" />
  <tool name="JustifyRight" />
  <tool name="JustifyFull" />
  <tool name="JustifyNone" />
  <tool separator="true"/>
  <tool name="Indent" />
  <tool name="Outdent" />
  <tool separator="true"/>
  <tool name="InsertOrderedList" />
  <tool name="InsertUnorderedList" />
  <tool separator="true"/>
  <tool name="ModuleManager" />
  <tool name="ToggleScreenMode" />
  <tool name="Zoom" />
 </tools>
 
 <modules>
  <module name="RadEditorStatistics" Visible="false" Enabled="true" />
  <module name="RadEditorDomInspector" Visible="false" Enabled="true" />
  <module name="RadEditorNodeInspector" Visible="false" Enabled="true" />
  <module name="RadEditorHtmlInspector" Visible="false" Enabled="true" />
 </modules>
 
 <snippets>
 
  <!--<snippet name="Tutorial Outline">
   <![CDATA[
 
    ]]>
  </snippet>-->
 
 </snippets>
 
</root>

We have some snippets in our rad editor config but I have removed them in the above code snippet due to security reasons. As I have said, the error seems very hard to replicate but it definitely occurs. I will be working to replicate this as well and post any of my findings here.

Thanks for the feedback so far,

-Jamie
0
Jamie
Top achievements
Rank 1
answered on 13 Apr 2011, 07:34 PM
bump
0
Jamie
Top achievements
Rank 1
answered on 13 Apr 2011, 09:06 PM
Another interesting thought about this issue. You mentioned that the preview button could cause some of these values to be changed. It just occurred to me that we are actually taking the content of the radeditor and saving it into a database while in preview mode in some cases. Then, we take the value in the database and load it back into the rad editor. I immediately thought that this could be causing it, but upon a closer inspection I was still unable to reproduce the error. Even when the editor is in preview mode I still cannot cause these targets to be generated =/

Just another thought, I hope that I can reproduce this error soon. Until then any input is appreciated.

Thanks,

Jamie
0
Dobromir
Telerik team
answered on 14 Apr 2011, 03:41 PM
Hi Jamie,

The provided RadEditor's configuration looks OK. To be able to provide more-to-the-point answer we will need reliable steps to reproduce the problem.

In addition, do you apply any modifications to the content (server- or client-side) before saving it?

Regards,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Jamie
Top achievements
Rank 1
answered on 14 Apr 2011, 04:47 PM
We do not do anything to the content before saving it. We use this code:
string strContentBody = ContentEditor.Content;
to get the content, then insert strContentBody into our database. Is there any more insight you can give me as to how the re_target property is actually generated?

Edit: Forgot to mention that I have still not been able to replicate this, but I strongly believe it has something to do with storing the content of the editor in the database while in preview mode.
0
Dan Ehrmann
Top achievements
Rank 1
answered on 16 Apr 2011, 12:00 AM
Jamie -

thought you may be interested - I also saw some 're-target' properties while researching a different problem - started a new thread - http://www.telerik.com/community/forums/aspnet-ajax/editor/anchors-and-preview-mode.aspx
0
Jamie
Top achievements
Rank 1
answered on 16 Apr 2011, 12:33 AM
Thanks, I'll post anything I find on here as well. But still can't replicate the bug =/
However, we did notice that content with this code could sometimes be cleaned up simply by going to html -> preview -> html and then being saved again. It seems that this is not always the case as sometimes I have to manually clear out all of the target properties though.
0
Dan Ehrmann
Top achievements
Rank 1
answered on 16 Apr 2011, 12:21 PM
I was able to reproduce the 're_target' problem by saving to the db while in preview mode
0
Dobromir
Telerik team
answered on 18 Apr 2011, 02:23 PM
Hi guys,

Are you able to reproduce the problem on the live demos? If so, could you please provide the exact steps that need to be executed, if not could you try to upgrade to the latest version of RadControls for ASP.NET AJAX (currently Q1 2011 SP1) and see if the problem still occurs?

Regarding the re_target attribute, this attribute is applied to the links when RadEditor is set to preview mode. When RadEditor's mode is changed to preview, the control applies to all the link in the content target attribute with value _blank to ensure that clicking on the link will open it in a new window. The original value of the target attribute is stored in the re_target attribute.

All the best,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Jamie
Top achievements
Rank 1
answered on 18 Apr 2011, 04:29 PM
Dan,

I was trying to get this re_target to generate and have been going to HTML, adding the following link:
<a href="#Download">Download Source</a>

Then, switching to preview mode. I have a button when clicked that grabs the content from the radeditor and stores it in a string. However, the string is always the same as my links. I was just wondering how exactly you were able to replicate it because I cannot seem to find a point where the re_targets get added.


Dobromir,

I believe that is exactly what is causing this issue. While in preview mode the changed links are getting stored into our DB, and then when reloaded from the DB are never cleared or fixed. However, as I have said before I still haven't been able to actually find a point when the content of the rad editor is returning links with the target properties. It seems that it doesn't always happen, i.e. sometimes while in preview mode the links are exactly the way they should be when I grab the 'Content' property of the rad editor.
0
Dan Ehrmann
Top achievements
Rank 1
answered on 18 Apr 2011, 05:51 PM
I didn't do anything other than click my save button while in preview mode
0
Dobromir
Telerik team
answered on 21 Apr 2011, 11:06 AM
Hi guys,

Could you please verify that you are using the latest version of RadControls for ASP.NET AJAX. If so, could you please provide a a video demonstrating the exact steps reproducing this problem along with the sample page.

We are still unable to reproduce this problem locally, and in order to be able to pinpoint the source of the issue we will need to examine it and debug it on our side.

At this point, the only possible workaround for this issue that I can suggest is to disable the Preview Mode. You can do this by setting the RadEditor's EditModes to Design and Html only, e.g.:
<telerik:RadEditor id="RadEditor1" runat="server" EditModes="Design,Html">
</telerik:RadEditor>


Greetings,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Dan Ehrmann
Top achievements
Rank 1
answered on 21 Apr 2011, 04:23 PM
In my thread, Rumen posted a script which seems to have resolved my problem - I think it applies here  as well
0
Laird Rixford
Top achievements
Rank 1
answered on 18 Jan 2013, 04:27 PM
Solved this by switching off of Preview Mode right before the save:
<script type="text/javascript">
    function clearPreviewMode() {
        var editor = $find("<%=RadEditor1.ClientID%>");
        if (editor.get_mode() == 4) {
            editor.set_mode(2);
        }
    }
</script>

And wiring up to the OnClientClick event of the save button.
<asp:button id="btnSave" runat="server" Text="Save Content" OnClientClick="clearPreviewMode();"></asp:button
Tags
Editor
Asked by
Jamie
Top achievements
Rank 1
Answers by
Jamie
Top achievements
Rank 1
Dobromir
Telerik team
Dan Ehrmann
Top achievements
Rank 1
Jamie
Top achievements
Rank 1
Laird Rixford
Top achievements
Rank 1
Share this question
or