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

special character and html problem

2 Answers 51 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Di
Top achievements
Rank 2
Di asked on 03 Feb 2012, 04:38 PM
This is my radedtor code.  when I enter this content : "İÖÜÇŞĞ ! + = . ; :"
result is : %3cspan style%3d%22font-family%3a arial%3b font-size%3a 13px%3b%22%3e%3cstrong%3eİÖÜÇŞĞ %21 %2b %3d . %3b %3a%3c/strong%3e%22 %3c/span%3e
how can fix this? I double checked all pages and config files. tryed many combination of content filters. what is wrong?

Editor Code :
Input : "İÖÜÇŞĞ ! + = . ; :"
Telerik.Web.UI.RadEditor RadControlWrite = new Telerik.Web.UI.RadEditor();
            RadControlWrite.ContentFilters = EditorFilters.DefaultFilters;
            RadControlWrite.DisableFilter(EditorFilters.ConvertCharactersToEntities);
            RadControlWrite.Width = 450;
            RadControlWrite.Height = 150;
            RadControlWrite.AutoResizeHeight = true;
            RadControlWrite.ToolsFile = "~/Manage/ResourceToolbar.xml";
            RadControlWrite.CssFiles.Clear();
            RadControlWrite.CssFiles.Add(new EditorCssFile("~/App_Themes/" + ConfigurationManager.AppSettings["Default_Theme"].ToString() + "/typography.css"));
            RadControlWrite.ToolbarMode = Telerik.Web.UI.EditorToolbarMode.Default;
            RadControlWrite.EditModes = EditModes.All;
            RadControlWrite.ID = "RadEditor" + IDCount.ToString();
            if (Object.Equals(SecondRadControl, null)) { SecondRadControl = RadControlWrite; } else { RadControlWrite.ToolProviderID = SecondRadControl.ID; }
 
            // Custom Translater Tool -----------------
            EditorToolGroup RadControlToolGroup = new EditorToolGroup();
            EditorDropDown TranslateDropDown = new EditorDropDown("TranslateTool");
            TranslateDropDown.Items.Add(new EditorDropDownItem("Türkçe","tr"));
            TranslateDropDown.Items.Add(new EditorDropDownItem("English","en"));
            RadControlToolGroup.Tools.Add(TranslateDropDown);
            RadControlWrite.Tools.Add(RadControlToolGroup);
 
            phResourceEditor.Controls.Add(RadControlWrite);

Saving Function
Output :   

Request.Form[string.Format("ctl00$ManageMasterContent$RadEditor{0}", IDCount)].ToString() 

"%3cspan style%3d%22font-family%3a arial%3b font-size%3a 13px%3b%22%3e%3cstrong%3eİÖÜÇŞĞ %21 %2b %3d . %3b %3a%3c/strong%3e%22 %3c/span%3e" string
int IDCount = 1;
foreach (System.Collections.Generic.KeyValuePair<string, string> ResourceDictionaryEntry in ResourceItems)
{
    RW.AddResource(ResourceDictionaryEntry.Key.ToString(), Request.Form[string.Format("ctl00$ManageMasterContent$RadEditor{0}", IDCount)].ToString() /** Important : if masterpage chanced this value can be null **/ );
    IDCount++;
}


2 Answers, 1 is accepted

Sort by
0
Di
Top achievements
Rank 2
answered on 06 Feb 2012, 11:43 AM
any idea?
0
Accepted
Rumen
Telerik team
answered on 07 Feb 2012, 04:36 PM
Hello,

Could you please explain why do you need to obtain the editor's content via the Request.Form? This approach is not recommended and the proper way is to use the RadEditor1.Content property.

You can find information about your scenario in the following forum thread: Encoding the Html on the client.


All the best,
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
Di
Top achievements
Rank 2
Answers by
Di
Top achievements
Rank 2
Rumen
Telerik team
Share this question
or