full downloads - Creating DNN Text Editor object form code behind
NZMK.com
 
  Minimize
View_Blog
 
Mar 4

Written by: host
3/4/2011 3:01 PM 

I try to create a new DNN Text Editor from code behind using following code

DotNetNuke.UI.UserControls.TextEditor te = new DotNetNuke.UI.UserControls.TextEditor();
PlaceHolder.Controls.Add(te);

But I got following error on the event viewer

DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.UserControls.TextEditor.PopulateLists() at DotNetNuke.UI.UserControls.TextEditor.Page_Load(Object sender, EventArgs e)

After two hours search, I found we need using following code to make it work

DotNetNuke.UI.WebControls.DNNRichTextEditControl te = new DotNetNuke.UI.WebControls.DNNRichTextEditControl(); PlaceHolder.Controls.Add(te);

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel