How to instantiate CuteEditor in a class file

  •  02-24-2010, 2:10 PM

    How to instantiate CuteEditor in a class file

    We need to implement CuteEditor as a custom control in our project, but are finding that it will not render correctly. What is the proper way to do this?
     
      public class CuteEditortextArea : Control
      {
        protected override System.Web.UI.Control OnSetupControls(List<System.Web.UI.Control> controls)
        {
          CuteEditor.Editor rte = new CuteEditor.Editor();
          controls.Add(rte);
          return rte;
        }
      }
     
    We end up with the following error when the page is ran:
     
    Object reference not set to an instance of an object.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 69:       foreach (System.Web.UI.Control control in controls) Line 70:       { Line 71:         control.RenderControl(writer); Line 72:       } Line 73: 
     
View Complete Thread