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

RadEditor adding a <br> tag automatically at the end of contents

10 Answers 111 Views
Editor
This is a migrated thread and some comments may be shown as answers.
shadow
Top achievements
Rank 2
shadow asked on 20 Nov 2012, 01:57 PM
Hello,

I am using rad editor on one of my page. I am adding RadEditor in a div which is sortable with jquery. Users can change the order of different divs on that page. 

My problem is that when user moves some div up or down the editor adds a <br> in the contents. I have no idea why it is happening, can anyone help me to avoid this behavior!!

Thanks

10 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Nov 2012, 03:41 PM
Hi,

Could you please provide a sample working project that demonstrates the problem along with steps to reproduce? You should also specify the browser under this issue occurs.


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
shadow
Top achievements
Rank 2
answered on 20 Nov 2012, 04:23 PM
Well,

I dont think that I can create a sample project, because I dont know the exactly the place where is the error and code in the project is very much complex, separated in different files and a lot of java script  :(

But , if you are interested I can give you the URL and login credentials to test it in our stagging enviornment??

I am having this problem in chrome 23.0.1271.64 
0
Rumen
Telerik team
answered on 20 Nov 2012, 04:46 PM
Hello,

We could take a look at your site, but I am not sure whether it will be 100% helpful and we will be able to debug and find the reason for the reported behavior.

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
shadow
Top achievements
Rank 2
answered on 21 Nov 2012, 11:10 AM
I will appreciate your efforts to give it a try regard less of the outcomes.

How can I send you the site address and the login details?? 
0
Rumen
Telerik team
answered on 21 Nov 2012, 03:09 PM
Hi,

I converted the forum to a general feedback ticket so you can safely share the credentials.

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
shadow
Top achievements
Rank 2
answered on 21 Nov 2012, 03:42 PM
Thanks,

Goto this page:
http://deleted_by_forum_admin

Username : deleted_by_forum_admin
Password: deleted_by_forum_admin

after login, go to this url:
http://deleted_by_forum_admin

See the image. 
0
shadow
Top achievements
Rank 2
answered on 21 Nov 2012, 03:43 PM
Image
0
shadow
Top achievements
Rank 2
answered on 21 Nov 2012, 03:55 PM
Here I am sending backend code we are using to set different properties for editor. We are adding editor dynamically to the page.

private void SetEditorProperties(ref Telerik.Web.UI.RadEditor Editor, int LanguageId)
       {
           ArrayList ClassList = StylesheetReader.GetClassList();
 
           Editor.EditModes = EditModes.Design | EditModes.Html;
 
           Editor.Width = new System.Web.UI.WebControls.Unit("100%", CultureInfo.InvariantCulture);
           Editor.Height = 0;
           Editor.AutoResizeHeight = true;
 
           Editor.ToolbarMode = Telerik.Web.UI.EditorToolbarMode.PageTop;
           Editor.ContentAreaMode = EditorContentAreaMode.Div;
           Editor.BackColor = System.Drawing.Color.Transparent;
           Editor.StripFormattingOnPaste = Telerik.Web.UI.EditorStripFormattingOptions.MSWordRemoveAll;
 
           Editor.ToolsFile = "/Modules/HtmlArticle/ToolsFile.xml";
           InternalLinks EditorLinks = new InternalLinks();
           Editor = EditorLinks.LoadLinks(Editor);
           Editor = CSSClass.LoadCSSToParagraphList(Editor);
           Editor.CssClasses.Clear();
           Editor.CssFiles.Clear();
           Editor.CssFiles.Add("/mb/pub/css/default.css");
           Editor.CssClass = "mb_modules_HtmlArticle_articleEditors";
             
           Editor.Skin = "Sitefinity";
           Editor.ExternalDialogsPath = "/Modules/EditorDialogs/";
 
           string[] ImagesPath = { "Files/bilder" };
           ImageManagerDialogConfiguration Config = new ImageManagerDialogConfiguration();
           Config.ContentProviderTypeName = typeof(ContentProviderHandler).AssemblyQualifiedName;
           Config.EnableImageEditor = true;
           Config.ViewPaths = ImagesPath;
           Config.DeletePaths = ImagesPath;
           Config.UploadPaths = ImagesPath;
 
           FileManagerDialogConfiguration Config2 = new FileManagerDialogConfiguration();
           Config2.ContentProviderTypeName = typeof(ContentProviderHandler).AssemblyQualifiedName;
           Config2.ViewPaths = ContentProviderCommonOperations.ContentProviderPath;
           Config2.DeletePaths = ContentProviderCommonOperations.ContentProviderPath;
           Config2.UploadPaths = ContentProviderCommonOperations.ContentProviderPath;
 
           FileManagerDialogConfiguration Config3 = new FileManagerDialogConfiguration();
           Config3.ContentProviderTypeName = typeof(ContentProviderHandler).AssemblyQualifiedName;
           Config3.ViewPaths = ContentProviderCommonOperations.ContentProviderPath;
           Config3.DeletePaths = ContentProviderCommonOperations.ContentProviderPath;
           Config3.UploadPaths = ContentProviderCommonOperations.ContentProviderPath;
           Config3.SearchPatterns = new string[] { "*.*" };
 
           Editor.ImageManager = Config;
           Editor.FlashManager = Config2;
           Editor.DocumentManager = Config3;
 
 
 
           //make sure that the tools file is loaded
           Editor.EnsureToolsFileLoaded();
           //clear default context menus collection
           Editor.ContextMenus.Clear();
 
           //Adding image map, context menu.
           EditorContextMenu forImageMap = new EditorContextMenu();
           forImageMap.TagName = "IMG";
           forImageMap.Tools.Add(new EditorTool("ImageMapDialog"));
           Editor.ContextMenus.Add(forImageMap);
 
           //set the active article when changing the mode of editor
           Editor.OnClientModeChange = "ActivateArticleWhenChangingViewMode";
       }
0
Accepted
Nikolay
Telerik team
answered on 23 Nov 2012, 01:15 PM
Hello,

Thank you for the credentials and back-end code.

We reproduced the issue on the provided link but unfortunately we were not able to debug it there.

Could you please try these tests?
- Change the RadEditor's ContentAreaMode property to Iframe and check for this behavior.
- Replace the RadEditor with content editable div (<div contenteditable="true" style="width:300px;height:300px;border: 1px solid red;">sample content</div>) and check for this behavior. This is needed to make sure the issue is not caused by the browser(Chrome).

As a possible workaround you could try to get the content before sorting (var content = editor.get_html(true)) and replace it after the sorting (editor.set_html(content)) so it will stay unchanged using JQuery sorting events.

I have also deleted your credentials and moved the general feedback ticket again to a forum thread.

Kind regards,
Nikolay
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
shadow
Top achievements
Rank 2
answered on 12 Dec 2012, 10:01 AM
Thank you, I am able to fix this, I have tried the trick you suggested and it worked very well indeed.

editor.get_html(true))
(
editor.set_html(content))
Tags
Editor
Asked by
shadow
Top achievements
Rank 2
Answers by
Rumen
Telerik team
shadow
Top achievements
Rank 2
Nikolay
Telerik team
Share this question
or