Well to start some clarification on the problem. The problem only occurs when I am launching a webpage using the debug mode in VS2008. Once the site is up and running, I do not get a problem. Both controls: The main one, and the one being loaded by that one, work fine independantly. The problem only occurs when the 1st control goes to load the 2nd control.
1st Control:
partial class PublishCustomView : ModuleBase, IActionable
{
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
ReadItemType();
LoadControlType();
}
private void LoadControlType()
{
ModuleBase mb = (ModuleBase)LoadControl(controlToLoad);
mb.ModuleConfiguration = ModuleConfiguration;
mb.ID = System.IO.Path.GetFileNameWithoutExtension(controlToLoad);
phControls.Controls.Add(mb);
}
}
Notes: ReadItemType(); simply sets the string controlToLoad.
2nd Control:
public partial class DetailedFirstItemList : ModuleBase
{
override protected void OnInit(EventArgs e)
{
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += this.Page_Load;
this.PreRender += this.Page_PreRender;
}
private void Page_Load(object sender, EventArgs e)
{
}
private void Page_PreRender(object sender, EventArgs e)
{}
}
Notes: Yes I know these methods are blank, there is nothing in them yet, because It doesn't even work with a simple static label control. And ModuleBase is just a class that inherits PortalModuleBase
From what I can tell everything is working the way its suppose to, except that it just keeps running through everything starting from the OnInit. And individually they both work, without loading another control.