protected override void CreateChildControls()
{
base.CreateChildControls();
editor =
new RadEditor();
editor.Editable =
true;
//editor.StripFormattingOnPaste = EditorStripFormattingOptions.MSWordRemoveAll;// "All";
editor.ToolsFile =
"/radcontrols/editor/ToolsDataFile.xml";
editor.RadControlsDir =
"/radcontrols/";
//UseFixedToolbar=false;
editor.ShowPreviewMode =
false;
editor.ShowSubmitCancelButtons =
false;
editor.SaveInFile =
false;
editor.ImagesFilters =
new string[] { "*.gif", "*.jpg", "*.png" };
editor.MaxDocumentSize = 5120000;
editor.ShowHtmlMode =
false;
editor.EnableContextMenus =
true;
editor.ConvertToXhtml =
false;
editor.Width =
new Unit(100, UnitType.Pixel);
editor.Height =
new Unit(200, UnitType.Pixel);
editor.ShowHtmlMode =
true;
editor.ID =
string.Concat(ID, "_Editor");
//editor.ClientID = this.ClientID + "_Editor";
editor.StripFormattingOnPaste =
EditorStripFormattingOptions.All;
//editor.ContextMenus.
//editor.OnClientLoad = "onEditorload";
Controls.Add(editor);
limiter =
new CharLimitValidator();
limiter.ID =
string.Concat(ID, "_Limiter");
limiter.ControlToValidate = editor.ID;
Controls.Add(limiter);
I need to give get_html value outside this control.
I try to following :
HtmlGenericControl js = new HtmlGenericControl("script");
js.Attributes.Add(
"language", "javascript");
js.InnerHtml +=
"var editor" + ClientID + " = $find('" + editor.ClientID + "');";
js.InnerHtml +=
this.ClientID + ".get_html = function () { return editor" + ClientID + ".get_text(); }";
//js.InnerHtml = this.ClientID + ".get_html = function () { return 'fff'; }";
Controls.Add(js);
but this code can't find this editor. Why? Please, help me
