Hi,
LLBL Pro version = 2.5 final
runtime version = v2.0.50727
Using ASP.NET 2.0
Database = MS SQL 2005
Scenario:
I have a Master page which contains a ContentPlaceHolder control to load web user contorls I've created. The user controls are being loaded dynamically at runtime. I have created a control that consists of a GridView that is bound to the LLBLGenProDataSource. I get the following exception thrown when attempting to switch from the user control that contains the LLBLGenProDataSource to another user control. Please note that this exception only ocurres when the LLBLGenProDataSource is present.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
SD.LLBLGen.Pro.ORMSupportClasses.LLBLGenProDataSourceBase.OnPageLoadComplete(Object sender, EventArgs e) +59
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnLoadComplete(EventArgs e) +2058120
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1209
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
The code in the Master page being used to load the controls dynamically:
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
string loadPath = "~/UserControls/" + e.Item.Value + ".ascx";
userControlPlaceHolder.Controls.Clear();
Control control = LoadControl(loadPath);
((IPlugin)control).Host = new PluginManager();
userControlPlaceHolder.Controls.Add(control);
Session["LoadPath"] = loadPath;
}