Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problem with loading multiple User ControlsProblem with loading multiple User Controls
Previous
 
Next
New Post
1/15/2009 11:05 AM
 

I've got a module where my main View control is suppose to load any one of a set of alternate user controls into a place holder within it depending on a setting choice. My problem is that while working with it in VS2008/2005 when I go to "Start" my website with or without debugging it goes into an infinite loop where it tries to constantly reload all the controls.

 I've looked at several modules, that don't have this problem but do the same thing, and I can't see anything wrong. The code to load the controls is as follows:

 

 

 

protected void OnInit(EventArgs e)base.OnInit(e); void SetControl(string controlToLoad)PortalModuleBase mb = (PortalModuleBase)Page.LoadControl(controlToLoad);if (mb != null)Path.GetFileNameWithoutExtension(controlToLoad);

 

{

 

SetControl(controlName);

}

private

{

 

 

{

mb.ModuleConfiguration = ModuleConfiguration;

mb.ID = System.IO.

phControl.Controls.Add(mb);

}

}

override

 
New Post
1/15/2009 2:16 PM
 
well that didn't really work out well heres the code:

override protected void OnInit(EventArgs e)
{
base.OnInit(e);
SetControl("control.ascx");
}

private void SetControl(string controlToLoad)
{
PortalModuleBase mb = (PortalModuleBase)Page.LoadControl(controlToLoad);
if (mb != null)
{
mb.ModuleConfiguration = ModuleConfiguration;
mb.ID = System.IO.Path.GetFileNameWithoutExtension(controlToLoad);
phControl.Controls.Add(mb);
}
}

I also worked out that it only happens when I have a time set for caching.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problem with loading multiple User ControlsProblem with loading multiple User Controls


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out