PLEASE HELP!!!
We are using RAD Editor for .Net 2.0 v6.6.3.0
We are trying to add two RadEditors from code behind to a page by using a wrapper class. Sample code:
using Telerik.WebControls; |
public class TextEditorControl : System.Web.UI.Page |
{ |
protected RadEditor editor; |
protected string id; |
public TextEditorControl(string id) : base() |
{ |
editor = new RadEditor(); |
this.id = id; |
} |
protected override void OnInit(EventArgs e) |
{ |
// Initialize all necessary properties |
editor.Editable = true; |
// ... |
this.Controls.Add(editor); |
editor.ID = this.id; // Changing editor id from "ctl00" to our custom id |
} |
} |
Later we add this control to one of the tabs in our main display page. Sample code:
public class MainPage : System.Web.UI.Page |
{ |
protected override void OnInit(EventArgs e) |
{ |
//Add controls to the page based on an xml settings file |
//... |
TableCell tdContainer; |
if (controlType = "TextEditorControl") |
{ |
tdContainer.Controls.Add(new TextEditorControl(controlId)); |
} |
//Other code |
//... |
} |
protected void Page_Error(Object sender, EventArgs e) |
{ |
//Catch the error as an exception |
} |
} |
For the first time, both RadEditor controls load fine. Then if we navigate to the next tab in the page, and try to navigate back to the previous tab containing the two RadEditor controls, we receive the following Exception caught through Page_Error function:
{"Multiple controls with the same ID '__Page' were found. FindControl requires that controls have unique IDs."} |
Kindly note that adding one RadEditor to the page always used to work fine for us (may be just one control with '__Page' id). Now we do have to add multiple controls. Please help!