Server Error in '/' Application.

Object reference not set to an instance of an object.

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:


Line 875:                catch (Exception)
Line 876:                {
Line 877:                    mainMenu.Items.FindByName("JOHN DEERE".ToUpper()).Selected = true;
Line 878:                }
Line 879:            }

Source File: C:\01-Projects\02-Websites\01-AGROGROUP\Live\Agrogroup.site_v18.2.3\Agrotech.Master.cs    Line: 877

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Agrotech.Agrotech.BuildSubMenu(String SiteName, String lang, String strUrl, String strPage, String urlPath, Boolean IsAdmin, String CurrentList) in C:\01-Projects\02-Websites\01-AGROGROUP\Live\Agrogroup.site_v18.2.3\Agrotech.Master.cs:877
   Agrotech.Agrotech.BuildTopNavigationBar(Boolean IsAdmin, String SiteName, String lang, String strUrl, String strPage, String urlPath, String CurrentList) in C:\01-Projects\02-Websites\01-AGROGROUP\Live\Agrogroup.site_v18.2.3\Agrotech.Master.cs:500
   Agrotech.Agrotech.Page_Load(Object sender, EventArgs e) in C:\01-Projects\02-Websites\01-AGROGROUP\Live\Agrogroup.site_v18.2.3\Agrotech.Master.cs:256
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Control.LoadRecursive() +184
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1532


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4682.0