Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  Dynamically Creating "TextEditor" and PortalSettings is null
Previous Previous
 
Next Next
New Post 6/6/2008 8:39 AM
User is offline pullp
34 posts
10th Ranked


Dynamically Creating "TextEditor" and PortalSettings is null 

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 v13wstat3.

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 v13wstat3 or somewhere?

 

Please any help is appreciated

 
New Post 6/6/2008 8:58 AM
User is offline pullp
34 posts
10th Ranked


Re: Dynamically Creating "TextEditor" and PortalSettings is null 

ok..after further debugging, I found that, PortalSettings was null from v13wstat3 but then it loads from GetHostPortal() something like that

 

It appears the exception comes from FCKEditor initialize. here is the trace

System.NullReferenceException was unhandled by user code
  Message="Object reference not set to an instance of an object."
  Source="DotNetNuke.FckHtmlEditorProvider"
  StackTrace:
       at DotNetNuke.HtmlEditor.FckHtmlEditorProvider.FckHtmlEditorProvider.Initialize()   
       at DotNetNuke.UI.UserControls.TextEditor.Page_Init(Object sender, EventArgs e)
       in C:\projects\textSite\src\Library\Controls\TextEditor.vb:line 413   
       at System.Web.UI.Control.OnInit(EventArgs e)   
       at System.Web.UI.UserControl.OnInit(EventArgs e)   
       at System.Web.UI.Control.InitRecursive(Control namingContainer)   
       at System.Web.UI.Control.InitRecursive(Control namingContainer)   
       at System.Web.UI.Control.InitRecursive(Control namingContainer)   
       at System.Web.UI.Control.InitRecursive(Control namingContainer)   
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException:

 

Anyone please

 
New Post 6/6/2008 11:11 AM
User is offline pullp
34 posts
10th Ranked


Re: Dynamically Creating "TextEditor" and PortalSettings is null 

ok..after further debugging I found that all ModuleConfiguration, PortalId, etc fields are null in the newly loaded control.

 

How do I load a user control such that it gets all these values set..my user control extends PortalModuleBase..but I am not loading this user control from a Class (which doesnt derive from PortalModulebase..Is this the issue??)

 

 

Can any one please explain me the basics of loading

 
New Post 6/6/2008 11:46 AM
User is offline Brian Dukes
479 posts
www.engagesoftware.com
8th Ranked


Re: Dynamically Creating "TextEditor" and PortalSettings is null 

That stuff is set through the ModuleConfiguration property, so you want something like viewControl.ModuleConfiguration = this.ModuleConfiguration;

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
314.966.4000

The leading provider of DotNetNuke support, training and custom module development.
 
New Post 6/7/2008 9:07 AM
User is offline pullp
34 posts
10th Ranked


Re: Dynamically Creating "TextEditor" and PortalSettings is null 

 Brian Dukes wrote

That stuff is set through the ModuleConfiguration property, so you want something like viewControl.ModuleConfiguration = this.ModuleConfiguration;

Hope it helps,

 

I thought of using that..but unfortunately it wouldnt work for me..

 

Because I am creating my "user control" in a web service (.asmx) which doesnt inherit from PortalModuleBase. 

For now, I removed RichTextEditor from my user control and directly outputting text to a Literal Control.

 

If you know a way to get PortalSettings or ModuleCOnfiguration from within a Class (that doesnt extend PortalModuleBase) please do let me know..That will help me to use all DNN Web Controls on my dynamic user control

 

TIA

 

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  Dynamically Creating "TextEditor" and PortalSettings is null
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/
Alki Homes - Seattle, WA
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com
Swanzey Internet Group LLC
DotNetNuke design, development, e-Commerce, hosting, maintenance, and training. Exclusively DotNetNuke.
www.swanzey.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP