New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Adding RadEditor dynamically to a page

HOW-TO

Add RadEditor programmatically to a page.

SOLUTION

You can place a placeholder in your ASPX/ASCX template, e.g.

 <asp:PlaceHolder runat="server" id="editorPlace" />  

and then, in Page_Load, instantiate a new Editor and add it to the controls collection of the placeholder. All properties of the edit can be set in Page_Load, e.g.

private void Page_Load(object sender, System.EventArgs e)
{ 
    RadEditor editor = new RadEditor();
    editor.ID = "RadEditor1";
    //editor.ToolsFile = "~/<folder>/ToolsFile.xml";
    editor.Enabled = true;
    editorPlace.Controls.Add(editor);   
}
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim editor As RadEditor = New RadEditor
    editor.ID = "RadEditor1"
     //editor.ToolsFile = "~/<folder>/ToolsFile.xml"
    editor.Enabled = True
    editorPlace.Controls.Add(editor)
End Sub
In this article
Not finding the help you need? Improve this article