All,
I have a user control which is subsclassed from PortalModuleBase.
I have a "controls/TextEditor" control on the user control.
In my application, I am dynamically loading the UserControl and then getting the html markup of it. (I have to send this markup across the wire to another module)
WHile Loading, I get a NullPpointerException in RichTextEditor.Initialize(), Upon debugging I noticed that PortalSettings is null from ViewState.
The code to dynamically load control is
Page pageHolder = new Page();
UserControlBase viewControl = (UserControlBase)pageHolder.LoadControl(path);
pageHolder.Controls.Add(viewControl);
StringWriter output = new StringWriter();
HttpContext.Current.Server.Execute(pageHolder, output, false);
return output.ToString();
If I remove texteditor from my control, everything works fine..Any DNN control is causing this error...
Now, if we have to load any control extending PortalModuleBase dynamically, do I have to do any thing for viewstate or somewhere?
Please any help is appreciated