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 90:         doc.Load(Server.MapPath("~/Admin/XmlFolder/Pages.xml"));
Line 91:         XmlNodeList parentNode = doc.SelectNodes("//*[@Page_ID=" + ID + "]");
Line 92:         return int.Parse(parentNode[0].Attributes["dep_ID"].Value);
Line 93:     }
Line 94: }

Source File: d:\inetpub\vhosts\egyco-209.package\egyco-egypt.com\wwwroot\userControll\ar_SiteMapDetailsPage.ascx.cs    Line: 92

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ar_SiteMapDetailsProvider.GetParent(Int32 ID) in d:\inetpub\vhosts\egyco-209.package\egyco-egypt.com\wwwroot\userControll\ar_SiteMapDetailsPage.ascx.cs:92
   ar_SiteMapDetailsProvider.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\egyco-209.package\egyco-egypt.com\wwwroot\userControll\ar_SiteMapDetailsPage.ascx.cs:28
   System.Web.UI.Control.OnLoad(EventArgs e) +98
   System.Web.UI.Control.LoadRecursive() +153
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Control.LoadRecursive() +250
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4081


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